From: Victor Julien Date: Tue, 20 Feb 2024 15:06:57 +0000 (+0100) Subject: detect: fix memory leak in error handling X-Git-Tag: suricata-8.0.0-beta1~1719 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb1d0c2cc2b673a8f751cd88546e7c37e33ab8e0;p=thirdparty%2Fsuricata.git detect: fix memory leak in error handling Pointed out by cppcheck: src/detect-parse.c:1544:9: error: Memory leak: sig.init_data [memleak] SCFree(sig); ^ Bug: #6527. --- diff --git a/src/detect-parse.c b/src/detect-parse.c index c297caecbc..243dbf9bef 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1541,6 +1541,7 @@ Signature *SigAlloc (void) sig->init_data->buffers = SCCalloc(8, sizeof(SignatureInitDataBuffer)); if (sig->init_data->buffers == NULL) { + SCFree(sig->init_data); SCFree(sig); return NULL; }