detect: fix coverity memory leak warnings

pull/3553/head
Victor Julien 7 years ago
parent 16100e592d
commit cb2008fb27

@ -218,7 +218,7 @@ int DetectIsdataatSetup (DetectEngineCtx *de_ctx, Signature *s, const char *isda
int sm_list; int sm_list;
if (s->init_data->list != DETECT_SM_LIST_NOTSET) { if (s->init_data->list != DETECT_SM_LIST_NOTSET) {
if (DetectBufferGetActiveList(de_ctx, s) == -1) if (DetectBufferGetActiveList(de_ctx, s) == -1)
return -1; goto end;
sm_list = s->init_data->list; sm_list = s->init_data->list;
if (idad->flags & ISDATAAT_RELATIVE) { if (idad->flags & ISDATAAT_RELATIVE) {

@ -83,10 +83,6 @@ int DetectReplaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *replac
return -1; return -1;
} }
int ret = DetectContentDataParse("replace", replacestr, &content, &len);
if (ret == -1)
return -1;
switch (run_mode) { switch (run_mode) {
case RUNMODE_NFQ: case RUNMODE_NFQ:
case RUNMODE_IPFW: case RUNMODE_IPFW:
@ -99,6 +95,10 @@ int DetectReplaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *replac
return 0; return 0;
} }
int ret = DetectContentDataParse("replace", replacestr, &content, &len);
if (ret == -1)
return -1;
/* add to the latest "content" keyword from pmatch */ /* add to the latest "content" keyword from pmatch */
const SigMatch *pm = DetectGetLastSMByListId(s, DETECT_SM_LIST_PMATCH, const SigMatch *pm = DetectGetLastSMByListId(s, DETECT_SM_LIST_PMATCH,
DETECT_CONTENT, -1); DETECT_CONTENT, -1);

Loading…
Cancel
Save