From: Victor Julien Date: Mon, 7 Sep 2020 08:25:37 +0000 (+0200) Subject: datasets: free old data when reusing a hash container X-Git-Tag: suricata-6.0.0-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=017c038bcba9ebe279e470cc48e1f440dfa0ef7d;p=thirdparty%2Fsuricata.git datasets: free old data when reusing a hash container --- diff --git a/src/util-thash.c b/src/util-thash.c index f062949b0f..717605d80e 100644 --- a/src/util-thash.c +++ b/src/util-thash.c @@ -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));