From: Danny Mayer Date: Thu, 1 Aug 2002 03:52:14 +0000 (+0000) Subject: Fixed code to check for NULL before freeing buffer X-Git-Tag: v9.2.3rc1~104^2~426 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=931e557ecf7758d62bd342a0dae32472f6ee6ba1;p=thirdparty%2Fbind9.git Fixed code to check for NULL before freeing buffer --- diff --git a/lib/isc/win32/strerror.c b/lib/isc/win32/strerror.c index 830f9c92dfe..f092ddd5142 100644 --- a/lib/isc/win32/strerror.c +++ b/lib/isc/win32/strerror.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: strerror.c,v 1.4 2002/02/20 03:35:46 marka Exp $ */ +/* $Id: strerror.c,v 1.5 2002/08/01 03:52:14 mayer Exp $ */ #include @@ -74,7 +74,7 @@ isc__strerror(int num, char *buf, size_t size) { snprintf(buf, size, "%s", msg); else snprintf(buf, size, "Unknown error: %u", unum); - if(freebuf == TRUE) { + if(freebuf && msg != NULL) { LocalFree(msg); } UNLOCK(&isc_strerror_lock);