detect/threshold: don't double init per thread cache

Can get called multiple times in the multi-tenancy case.

(cherry picked from commit cefee1390e)
pull/16123/head
Victor Julien 3 months ago
parent b72d0df5a9
commit 8b665b1e63

@ -504,6 +504,9 @@ int ThresholdCacheThreadInit(DetectEngineThreadCtx *det_ctx)
{
if (thread_storage_id.id < 0)
return 0;
/* we can get called more than once per thread for MT */
if (ThreadGetStorageById(det_ctx->tv, thread_storage_id) != NULL)
return 0;
struct ThresholdCacheThreadCtx *tctx = SCCalloc(1, sizeof(*tctx));
if (tctx == NULL)

Loading…
Cancel
Save