diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-08-11 15:40:35 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-08-11 15:40:35 (GMT) |
commit | 677ed2cb68a5847314252eaacfd63ad7fb956551 (patch) | |
tree | 3bece3f63f315f56f60df0db3cb0b861c7e1aa29 /Python/compile.c | |
parent | 3128dcdfc3a3823508e62e57f990a0f1b7e58d42 (diff) | |
download | cpython-677ed2cb68a5847314252eaacfd63ad7fb956551.zip cpython-677ed2cb68a5847314252eaacfd63ad7fb956551.tar.gz cpython-677ed2cb68a5847314252eaacfd63ad7fb956551.tar.bz2 |
SF bug # 557028, illegal use of malloc/free
This only applies to 2.2. Use PyMem_Malloc/Free instead of malloc/free.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index 6cf13c9..cdd8b1b 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1958,7 +1958,7 @@ com_factor(struct compiling *c, node *n) return; } if (childtype == MINUS) { - char *s = malloc(strlen(STR(pnum)) + 2); + char *s = PyMem_Malloc(strlen(STR(pnum)) + 2); if (s == NULL) { com_error(c, PyExc_MemoryError, ""); com_addbyte(c, 255); @@ -1966,7 +1966,7 @@ com_factor(struct compiling *c, node *n) } s[0] = '-'; strcpy(s + 1, STR(pnum)); - free(STR(pnum)); + PyMem_Free(STR(pnum)); STR(pnum) = s; } com_atom(c, patom); |