[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4211 - trunk/OpenDNSSEC/enforcer/ksm/include/ksm

Sion Lloyd sion at nominet.org.uk
Tue Nov 23 12:27:45 CET 2010


Author: sion
Date: 2010-11-23 12:27:45 +0100 (Tue, 23 Nov 2010)
New Revision: 4211

Modified:
   trunk/OpenDNSSEC/enforcer/ksm/include/ksm/memory.h
Log:
Avoid possibility of a double-free, from ticket 197.


Modified: trunk/OpenDNSSEC/enforcer/ksm/include/ksm/memory.h
===================================================================
--- trunk/OpenDNSSEC/enforcer/ksm/include/ksm/memory.h	2010-11-23 10:37:58 UTC (rev 4210)
+++ trunk/OpenDNSSEC/enforcer/ksm/include/ksm/memory.h	2010-11-23 11:27:45 UTC (rev 4211)
@@ -47,7 +47,7 @@
 void* MemMalloc(size_t size);
 void* MemCalloc(size_t nmemb, size_t size);
 void* MemRealloc(void* ptr, size_t size);
-#define MemFree(ptr) {free(ptr); (ptr) = NULL;}
+#define MemFree(ptr) {if(ptr != NULL) {free(ptr); (ptr) = NULL;}}
 
 #ifdef __cplusplus
 }




More information about the Opendnssec-commits mailing list