]> granicus.if.org Git - python/commitdiff
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
authorBrett Cannon <bcannon@gmail.com>
Thu, 25 May 2006 20:44:08 +0000 (20:44 +0000)
committerBrett Cannon <bcannon@gmail.com>
Thu, 25 May 2006 20:44:08 +0000 (20:44 +0000)
Python/pystrtod.c

index db4cad17d7524036e4d2639ad907b3e37a35615b..8a71c285a97d8182f7da4c65d6a26484a9f84d41 100644 (file)
@@ -101,7 +101,7 @@ PyOS_ascii_strtod(const char *nptr, char **endptr)
                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 @@ PyOS_ascii_strtod(const char *nptr, char **endptr)
                                fail_pos = (char *)nptr + (fail_pos - copy);
                }
 
-               free(copy);
+               PyMem_FREE(copy);
 
        }
        else {