]> 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 <victor@inliniac.net>
Mon, 7 Sep 2020 08:25:37 +0000 (10:25 +0200)
src/util-thash.c

index f062949b0fee53902c144a53eb97e4f97a5740a6..717605d80e7656e285388377e2f86ce8309ebd0c 100644 (file)
@@ -731,6 +731,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));