]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
signature: fix memory leak in DetectBytejumpSetup
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 20 May 2019 08:06:25 +0000 (10:06 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 28 May 2019 09:10:34 +0000 (11:10 +0200)
src/detect-bytejump.c

index b42dc6f03b0cff23da192da787bd985cc20c5cae..c277da03fd0a80b729be362aa2e61dbe9428b2fb 100644 (file)
@@ -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;
 }