From: Victor Julien Date: Sat, 16 Mar 2019 07:05:17 +0000 (+0100) Subject: detect/mark: minor code cleanups X-Git-Tag: suricata-5.0.0-beta1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dbf600d64118175f0989714600ea17d3b510209;p=thirdparty%2Fsuricata.git detect/mark: minor code cleanups --- diff --git a/src/detect-mark.c b/src/detect-mark.c index 1dc41f9b2f..bdb8fe0e21 100644 --- a/src/detect-mark.c +++ b/src/detect-mark.c @@ -184,29 +184,24 @@ static void * DetectMarkParse (const char *rawstr) */ static int DetectMarkSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { -#ifdef NFQ - DetectMarkData *data = NULL; - SigMatch *sm = NULL; - - data = DetectMarkParse(rawstr); - +#ifndef NFQ + return 0; +#else + DetectMarkData *data = DetectMarkParse(rawstr); if (data == NULL) { return -1; - } else { - sm = SigMatchAlloc(); - if (sm == NULL) { - DetectMarkDataFree(data); - return -1; - } + } + SigMatch *sm = SigMatchAlloc(); + if (sm == NULL) { + DetectMarkDataFree(data); + return -1; + } - sm->type = DETECT_MARK; - sm->ctx = (SigMatchCtx *)data; + sm->type = DETECT_MARK; + sm->ctx = (SigMatchCtx *)data; - /* Append it to the list of tags */ - SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_TMATCH); - return 0; - } -#else + /* Append it to the list of tags */ + SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_TMATCH); return 0; #endif }