]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
call request_global_free() after request_global_init()
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 Jan 2024 17:46:13 +0000 (12:46 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 Jan 2024 17:46:13 +0000 (12:46 -0500)
src/lib/server/pair_server_tests.c
src/lib/server/tmpl_dcursor_tests.c

index af11ff920490bdf1d850627f3be21daf6dab2cfb..f1925ac57e8dbff053b72a5d791e6d24454eb231 100644 (file)
  */
 #ifdef USE_CONSTRUCTOR
 static void test_init(void) __attribute__((constructor));
+static void test_free(void) __attribute__((destructor));
 #else
 static void test_init(void);
 #  define TEST_INIT  test_init()
+#  define TEST_FINI  test_free()
 #endif
 
 #include <freeradius-devel/util/acutest.h>
@@ -87,6 +89,11 @@ static void test_init(void)
        if (request_global_init() < 0) goto error;
 }
 
+static void test_free(void)
+{
+       request_global_free();
+}
+
 static request_t *request_fake_alloc(void)
 {
        request_t       *request;
index 3720ec181221099c111ebb843e31af8368ae9b95..ec8191d55dd382504872e10c56d99530ed5b3b8c 100644 (file)
@@ -1,10 +1,12 @@
 #define USE_CONSTRUCTOR
 
 #ifdef USE_CONSTRUCTOR
-static void test_init(void) __attribute((constructor));
+static void test_init(void) __attribute__((constructor));
+static void test_free(void) __attribute__((destructor));
 #else
 static void test_init(void);
-#define TEST_INIT test_init()
+#  define TEST_INIT  test_init()
+#  define TEST_FINI  test_free()
 #endif
 
 #include <freeradius-devel/util/acutest.h>
@@ -40,6 +42,11 @@ static void test_init(void)
        if (request_global_init() < 0) goto error;
 }
 
+static void test_free(void)
+{
+       request_global_free();
+}
+
 static request_t *request_fake_alloc(void)
 {
        request_t       *request;