From: Arran Cudbard-Bell Date: Wed, 4 Apr 2018 15:01:42 +0000 (+0100) Subject: If we're explicitly freeing the strerror buffer, don't allow it to be used later X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d2bc5f7fdb656a56bf21a4f427bba888f51d8cf;p=thirdparty%2Ffreeradius-server.git If we're explicitly freeing the strerror buffer, don't allow it to be used later --- diff --git a/src/lib/util/strerror.c b/src/lib/util/strerror.c index a643f4c959b..1c4448e4163 100644 --- a/src/lib/util/strerror.c +++ b/src/lib/util/strerror.c @@ -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