signature: leak fix in DetectAddressParse2

pull/4319/head
Philippe Antoine 6 years ago committed by Victor Julien
parent c1e41632c1
commit 989a6461b0

@ -911,8 +911,12 @@ static int DetectAddressParse2(const DetectEngineCtx *de_ctx,
DetectAddressPrint(tmp_ad);
}
#endif
if (DetectAddressMergeNot(&tmp_gh, &tmp_ghn) < 0)
if (DetectAddressMergeNot(&tmp_gh, &tmp_ghn) < 0) {
DetectAddressHeadCleanup(&tmp_ghn);
DetectAddressHeadCleanup(&tmp_gh);
goto error;
}
DetectAddressHeadCleanup(&tmp_ghn);
SCLogDebug("merged succesfully");
@ -922,6 +926,7 @@ static int DetectAddressParse2(const DetectEngineCtx *de_ctx,
tmp_ad2 = DetectAddressCopy(tmp_ad);
if (tmp_ad2 == NULL) {
SCLogDebug("DetectAddressCopy failed");
DetectAddressHeadCleanup(&tmp_gh);
goto error;
}
DetectAddressPrint(tmp_ad2);
@ -934,6 +939,7 @@ static int DetectAddressParse2(const DetectEngineCtx *de_ctx,
tmp_ad2 = DetectAddressCopy(tmp_ad);
if (tmp_ad2 == NULL) {
SCLogDebug("DetectAddressCopy failed");
DetectAddressHeadCleanup(&tmp_gh);
goto error;
}
DetectAddressPrint(tmp_ad2);
@ -941,7 +947,6 @@ static int DetectAddressParse2(const DetectEngineCtx *de_ctx,
}
DetectAddressHeadCleanup(&tmp_gh);
DetectAddressHeadCleanup(&tmp_ghn);
}
n_set = 0;
}

Loading…
Cancel
Save