From f3c7877fb5279f28d8c2b509b1c20caeeb21dc1a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 8 Oct 2025 17:25:54 +0200 Subject: [PATCH] unittests: clean up memory for radix tests --- src/util-radix4-tree.c | 6 +++++- src/util-radix6-tree.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/util-radix4-tree.c b/src/util-radix4-tree.c index 942023b81d..7c7a448d5b 100644 --- a/src/util-radix4-tree.c +++ b/src/util-radix4-tree.c @@ -365,8 +365,12 @@ bool SCRadix4CompareTrees( /*------------------------------------Unit_Tests------------------------------*/ #ifdef UNITTESTS +static void SCRadix4UtFree(void *ptr) +{ + SCFree(ptr); +} -static const SCRadix4Config ut_ip_radix4_config = { NULL, NULL }; +static const SCRadix4Config ut_ip_radix4_config = { SCRadix4UtFree, NULL }; #define GET_IPV4(str) \ SCLogDebug("setting up %s", (str)); \ diff --git a/src/util-radix6-tree.c b/src/util-radix6-tree.c index eddbd39d53..659315d857 100644 --- a/src/util-radix6-tree.c +++ b/src/util-radix6-tree.c @@ -424,8 +424,12 @@ bool SCRadix6CompareTrees( /*------------------------------------Unit_Tests------------------------------*/ #ifdef UNITTESTS +static void SCRadix6UtFree(void *ptr) +{ + SCFree(ptr); +} -static const SCRadix6Config ut_ip_radix6_config = { NULL, NULL }; +static const SCRadix6Config ut_ip_radix6_config = { SCRadix6UtFree, NULL }; #define GET_IPV6(str) \ SCLogDebug("setting up %s", (str)); \