mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
This commit is contained in:
parent
9d67d5e9f7
commit
0ed05875b2
1 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ PyOS_ascii_strtod(const char *nptr, char **endptr)
|
||||||
char *copy, *c;
|
char *copy, *c;
|
||||||
|
|
||||||
/* We need to convert the '.' to the locale specific decimal point */
|
/* 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;
|
c = copy;
|
||||||
memcpy(c, nptr, decimal_point_pos - nptr);
|
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);
|
fail_pos = (char *)nptr + (fail_pos - copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(copy);
|
PyMem_FREE(copy);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue