From b225ac1b9b0dcc07e123c37e1a498d850d67ecbd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 20 Feb 2024 16:06:57 +0100 Subject: [PATCH] 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. (cherry picked from commit eb1d0c2cc2b673a8f751cd88546e7c37e33ab8e0) --- src/detect-parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/detect-parse.c b/src/detect-parse.c index b5e214df24..c3232b97da 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1540,6 +1540,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; }