]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow syserror to be explicitly freed
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 1 Mar 2019 05:50:47 +0000 (13:50 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 1 Mar 2019 09:14:36 +0000 (17:14 +0800)
src/bin/unit_test_module.c
src/lib/util/syserror.c
src/lib/util/syserror.h

index 28e3302f957b062bd14c361173f8f531d42c0024..1fd3d9e4b28ec6fa6a9a3e02583089a7d6f6c738 100644 (file)
@@ -1147,6 +1147,12 @@ cleanup:
         */
        fr_dict_free(&dict);
 
+       /*
+        *      Explicitly cleanup the buffer used for storing syserror messages
+        *      This cuts down on address sanitiser output on error.
+        */
+       fr_syserror_free();
+
        /*
         *      Call pthread destructors.  Which aren't normally
         *      called for the main thread.
index 0b1522f704ad56f2510f606827d6cc65551c3361..6c38501eaaa168ce6830ec505db71ca321bcf1ea 100644 (file)
@@ -261,3 +261,11 @@ char const *fr_syserror(int num)
 #endif
 }
 
+/** Explicitly cleanup the thread specific buffer used
+ *
+ */
+void fr_syserror_free(void)
+{
+       _fr_logging_free(NULL);
+}
+
index 80147189c8d55b7de8445d252319f1adf6d77c5e..5239ffc72a3b6b04fcd6bf1dabb3528b2b73da85 100644 (file)
@@ -36,6 +36,7 @@ extern "C" {
 #include <string.h>
 
 char const     *fr_syserror(int num);
+void           fr_syserror_free(void);
 
 #ifdef __cplusplus
 }