thash: add debug validation check for use_cnt

pull/6409/head
Victor Julien 4 years ago committed by Philippe Antoine
parent 7a797631e0
commit 2ef857e533

@ -33,6 +33,7 @@
#include "util-byte.h"
#include "util-hash-lookup3.h"
#include "util-validate.h"
static THashData *THashGetUsed(THashTableContext *ctx);
static void THashDataEnqueue (THashDataQueue *q, THashData *h);
@ -186,6 +187,8 @@ error:
static void THashDataFree(THashTableContext *ctx, THashData *h)
{
if (h != NULL) {
DEBUG_VALIDATE_BUG_ON(SC_ATOMIC_GET(h->use_cnt) != 0);
if (h->data != NULL) {
ctx->config.DataFree(h->data);
}

Loading…
Cancel
Save