[mw-devel] MW3 r1300 - trunk/src

psycodom at sucs.org psycodom at sucs.org
Wed Nov 28 19:28:38 GMT 2012


Author: psycodom
Date: 2012-11-28 19:28:38 +0000 (Wed, 28 Nov 2012)
New Revision: 1300

Modified:
   trunk/src/hash.c
Log:
Fixes a strdup(NULL) someone introduced so he could add lots of compiler warnings that somehow don't warn him he's strdup()ing NULL ;)


Modified: trunk/src/hash.c
===================================================================
--- trunk/src/hash.c	2012-11-28 17:11:50 UTC (rev 1299)
+++ trunk/src/hash.c	2012-11-28 19:28:38 UTC (rev 1300)
@@ -185,7 +185,11 @@
 
     newrec = hash_enter(op);
     newrec->type = type;
-    newrec->data.pdata = strdup(value);
+    newrec->data.pdata=NULL;
+    if(value != NULL)
+    {
+		newrec->data.pdata = strdup(value);
+	}
 }
 
 void hash_set_i(hash_op_t *op, rectype_t type, int value)




More information about the mw-devel mailing list