[Python-checkins] r46253 - python/trunk/Python/pystrtod.c

brett.cannon python-checkins at python.org
Thu May 25 22:44:08 CEST 2006


Author: brett.cannon
Date: Thu May 25 22:44:08 2006
New Revision: 46253

Modified:
   python/trunk/Python/pystrtod.c
Log:
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .


Modified: python/trunk/Python/pystrtod.c
==============================================================================
--- python/trunk/Python/pystrtod.c	(original)
+++ python/trunk/Python/pystrtod.c	Thu May 25 22:44:08 2006
@@ -101,7 +101,7 @@
 		char *copy, *c;
 
 		/* We need to convert the '.' to the locale specific decimal point */
-		copy = (char *)malloc(end - nptr + 1 + decimal_point_len);
+		copy = (char *)PyMem_MALLOC(end - nptr + 1 + decimal_point_len);
 
 		c = copy;
 		memcpy(c, nptr, decimal_point_pos - nptr);
@@ -122,7 +122,7 @@
 				fail_pos = (char *)nptr + (fail_pos - copy);
 		}
 
-		free(copy);
+		PyMem_FREE(copy);
 
 	}
 	else {


More information about the Python-checkins mailing list