From: Victor Julien Date: Tue, 23 Oct 2018 12:34:08 +0000 (+0200) Subject: isdataat: fix mem leak in error path X-Git-Tag: suricata-4.0.6~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c66091cbb70e367e6b52e3588f7c0a242c4fd881;p=thirdparty%2Fsuricata.git isdataat: fix mem leak in error path --- diff --git a/src/detect-isdataat.c b/src/detect-isdataat.c index 01631d8dbb..9e73efd860 100644 --- a/src/detect-isdataat.c +++ b/src/detect-isdataat.c @@ -241,6 +241,7 @@ int DetectIsdataatSetup (DetectEngineCtx *de_ctx, Signature *s, const char *isda idad->flags |= ISDATAAT_OFFSET_BE; SCLogDebug("isdataat uses byte_extract with local id %u", idad->dataat); SCFree(offset); + offset = NULL; } /* 'ends with' scenario */ @@ -283,6 +284,8 @@ int DetectIsdataatSetup (DetectEngineCtx *de_ctx, Signature *s, const char *isda ret = 0; end: + if (offset) + SCFree(offset); if (ret != 0) DetectIsdataatFree(idad); return ret;