util/thash: decrease memuse if array was allocated

THashInitConfig may not allocate array and increase memuse.
Such a failure leads to THashShutdown which should not decrease
the memuse.

Ticket: 7135
pull/11431/head
Philippe Antoine 8 months ago committed by Victor Julien
parent 35dffc6b32
commit eeec609ac8

@ -378,8 +378,8 @@ void THashShutdown(THashTableContext *ctx)
}
SCFreeAligned(ctx->array);
ctx->array = NULL;
(void)SC_ATOMIC_SUB(ctx->memuse, ctx->config.hash_size * sizeof(THashHashRow));
}
(void) SC_ATOMIC_SUB(ctx->memuse, ctx->config.hash_size * sizeof(THashHashRow));
THashDataQueueDestroy(&ctx->spare_q);
DEBUG_VALIDATE_BUG_ON(SC_ATOMIC_GET(ctx->memuse) != 0);
SCFree(ctx);

Loading…
Cancel
Save