mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 01:10:00 -04:00
Fixed code to check for NULL before freeing buffer
This commit is contained in:
parent
1ceb6aa154
commit
931e557ecf
1 changed files with 2 additions and 2 deletions
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue