]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
datasets: free old data when reusing a hash container
authorVictor Julien <victor@inliniac.net>
Mon, 7 Sep 2020 08:25:37 +0000 (10:25 +0200)
committerVictor Julien <vjulien@oisf.net>
Sun, 19 Dec 2021 14:18:49 +0000 (15:18 +0100)
(cherry picked from commit 017c038bcba9ebe279e470cc48e1f440dfa0ef7d)

src/util-thash.c

index f5c9db145c00ae8cf6dadb66562c64a06f204ab3..395336c2569dcc64a6c96c18cc37b54d6fec4e6e 100644 (file)
@@ -753,6 +753,9 @@ static THashData *THashGetUsed(THashTableContext *ctx)
         h->prev = NULL;
         HRLOCK_UNLOCK(hb);
 
+        if (h->data != NULL) {
+            ctx->config.DataFree(h->data);
+        }
         SCMutexUnlock(&h->m);
 
         (void) SC_ATOMIC_ADD(ctx->prune_idx, (ctx->config.hash_size - cnt));