]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
If we're explicitly freeing the strerror buffer, don't allow it to be used later
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Apr 2018 15:01:42 +0000 (16:01 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Apr 2018 15:01:42 +0000 (16:01 +0100)
src/lib/util/strerror.c

index a643f4c959b3d1aef2fed3c460f90289f1a67a8e..1c4448e41634de42398521776515abfd980ea4d5 100644 (file)
@@ -66,6 +66,8 @@ static void _fr_logging_free(void *arg)
         *      of tracking and doesn't report a leak.
         */
        talloc_free(arg);
+       fr_strerror_buffer = NULL;
+
        logging_stop = true;
 }
 
@@ -321,7 +323,8 @@ void fr_perror(char const *fmt, ...)
  */
 void fr_strerror_free(void)
 {
-       talloc_free(fr_strerror_buffer);
+       TALLOC_FREE(fr_strerror_buffer);
+       logging_stop = true;
 }
 
 #ifdef TESTING_STRERROR