From 56915b2cc1d69c20807569946b01f3948e04c7a5 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 20 Feb 2024 16:06:08 +0100 Subject: [PATCH] detect/address: avoid cppcheck false positive src/detect-engine-address.c:1386:5: error: Memory leak: map.string [memleak] return true; ^ Seems cppcheck looses track of the pointer after the unnecessary cast to void. Bug: #6527. (cherry picked from commit 78703bbc865a1dd15a1ae1c4c996b0150096ed0e) --- src/detect-engine-address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index f0d425b2bc..191e8f504d 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -1377,7 +1377,7 @@ static bool DetectAddressMapAdd(DetectEngineCtx *de_ctx, const char *string, map->address = address; map->contains_negation = contains_negation; - if (HashListTableAdd(de_ctx->address_table, (void *)map, 0) != 0) { + if (HashListTableAdd(de_ctx->address_table, map, 0) != 0) { SCFree(map->string); SCFree(map); return false; -- 2.47.2