detect/mark: minor code cleanups

pull/3739/head
Victor Julien 6 years ago
parent bd31e4e332
commit 4dbf600d64

@ -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
}

Loading…
Cancel
Save