From: Philippe Antoine Date: Mon, 20 May 2019 08:06:25 +0000 (+0200) Subject: signature: fix memory leak in DetectBytejumpSetup X-Git-Tag: suricata-5.0.0-rc1~455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a370d2a91d2ef0b649517ab5231fdbc959258e18;p=thirdparty%2Fsuricata.git signature: fix memory leak in DetectBytejumpSetup --- diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index b42dc6f03b..c277da03fd 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -586,6 +586,7 @@ static int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, const char data->offset = ((DetectByteExtractData *)bed_sm->ctx)->local_id; data->flags |= DETECT_BYTEJUMP_OFFSET_BE; SCFree(offset); + offset = NULL; } sm = SigMatchAlloc(); @@ -613,6 +614,9 @@ static int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, const char ret = 0; return ret; error: + if (offset != NULL) { + SCFree(offset); + } DetectBytejumpFree(data); return ret; }