datasets: free old data when reusing a hash container

pull/5376/head
Victor Julien 5 years ago
parent 00f77f9643
commit 017c038bcb

@ -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));

Loading…
Cancel
Save