]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unittests: clean up memory for radix tests
authorVictor Julien <vjulien@oisf.net>
Wed, 8 Oct 2025 15:25:54 +0000 (17:25 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 14 Oct 2025 17:40:56 +0000 (19:40 +0200)
src/util-radix4-tree.c
src/util-radix6-tree.c

index 942023b81df87d44c30c987c813c8d86335d691d..7c7a448d5bbb4ffb5fe31eba9ac13406429f305f 100644 (file)
@@ -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));                                                            \
index eddbd39d5332ae75b43538352656c23b1d157806..659315d85720c1a926ee346e28df5926d9213a11 100644 (file)
@@ -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));                                                            \