]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Try and fix use after free in logging buffer
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Apr 2018 17:02:46 +0000 (18:02 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Apr 2018 17:02:46 +0000 (18:02 +0100)
src/lib/util/syserror.c

index a5fed0f5142e38c928a6d83e3ebaa61dd51c26b7..cb17c75f8ea903ca7b1b7f8feedaa9834e530750 100644 (file)
@@ -34,9 +34,9 @@ fr_thread_local_setup(char *, fr_syserror_buffer)             /* macro */
  *     Explicitly cleanup the memory allocated to the error buffer,
  *     just in case valgrind complains about it.
  */
-static void _fr_logging_free(void *arg)
+static void _fr_logging_free(UNUSED void *arg)
 {
-       talloc_free(arg);
+       TALLOC_FREE(fr_syserror_buffer);        /* Set to NULL in case the buffer needs to be recreated */
 }
 
 /** POSIX-2008 errno macros