From: Victor Julien Date: Mon, 9 Dec 2013 20:19:11 +0000 (+0100) Subject: port: don't lead memory on port parsing failure X-Git-Tag: suricata-2.0beta2~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5db0cc033f05861efd53bd02e4de4b871761557;p=thirdparty%2Fsuricata.git port: don't lead memory on port parsing failure [src/detect-engine-port.c:1354]: (error) Memory leak: gh --- diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index 4bd51d9163..257118d558 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -1326,11 +1326,13 @@ int DetectPortTestConfVars(void) "Port var \"%s\" probably has a sequence(something " "in brackets) value set without any quotes. Please " "quote it using \"..\".", seq_node->name); + DetectPortCleanupList(gh); goto error; } int r = DetectPortParseDo(&gh, &ghn, seq_node->val, /* start with negate no */0); if (r < 0) { + DetectPortCleanupList(gh); goto error; } @@ -1340,6 +1342,8 @@ int DetectPortTestConfVars(void) "with it's value \"%s\". Port space range is NIL. " "Probably have a !any or a port range that supplies " "a NULL address range", seq_node->name, seq_node->val); + DetectPortCleanupList(gh); + DetectPortCleanupList(ghn); goto error; }