From 931e557ecf7758d62bd342a0dae32472f6ee6ba1 Mon Sep 17 00:00:00 2001 From: Danny Mayer Date: Thu, 1 Aug 2002 03:52:14 +0000 Subject: [PATCH] Fixed code to check for NULL before freeing buffer --- lib/isc/win32/strerror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/isc/win32/strerror.c b/lib/isc/win32/strerror.c index 830f9c92df..f092ddd514 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);