From 8a472c5b9e581d5b7257960b9d37e4aa8904aa73 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 17 Dec 2025 20:31:57 +0100 Subject: [PATCH] util-spm-hs: add missing deallocator Add missing deallocator when hs_alloc_scratch fails. Bug: #8146 (cherry picked from commit 251d10fa42c25db64476442fb97c0ab162690247) --- src/util-spm-hs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util-spm-hs.c b/src/util-spm-hs.c index cfcb8acd52..9d5cebd6ab 100644 --- a/src/util-spm-hs.c +++ b/src/util-spm-hs.c @@ -96,6 +96,7 @@ static int HSBuildDatabase(const uint8_t *needle, uint16_t needle_len, /* If scratch allocation failed, this is not recoverable: other SPM * contexts may need this scratch space. */ SCLogError("Unable to alloc scratch for Hyperscan, returned %d.", err); + hs_free_database(db); return -1; } global_thread_ctx->ctx = scratch;