From 62793c573f0af6001475fc87b229239a2acc68eb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 6 Oct 2025 11:45:36 +0200 Subject: [PATCH] unittests: don't leak memory with --list-unittests (cherry picked from commit 57d1f20dfaa8144c6938cb7487f5ceaaf57181ef) --- src/runmode-unittests.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runmode-unittests.c b/src/runmode-unittests.c index 69a37788b8..ffa82ef5aa 100644 --- a/src/runmode-unittests.c +++ b/src/runmode-unittests.c @@ -254,6 +254,11 @@ void RunUnittests(int list_unittests, const char *regex_arg) TagInitCtx(); + /* test and initialize the unit testing subsystem */ + if (regex_arg == NULL) { + regex_arg = ".*"; + UtRunSelftest(regex_arg); /* inits and cleans up again */ + } UtInitialize(); RegisterAllModules(); @@ -261,11 +266,6 @@ void RunUnittests(int list_unittests, const char *regex_arg) HostBitInitCtx(); StorageFinalize(); - /* test and initialize the unit testing subsystem */ - if (regex_arg == NULL){ - regex_arg = ".*"; - UtRunSelftest(regex_arg); /* inits and cleans up again */ - } AppLayerHtpEnableRequestBodyCallback(); AppLayerHtpNeedFileInspection();