From: Neal Norwitz Date: Sun, 11 Aug 2002 15:40:35 +0000 (+0000) Subject: SF bug # 557028, illegal use of malloc/free X-Git-Tag: v2.2.2b1~225 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=677ed2cb68a5847314252eaacfd63ad7fb956551;p=thirdparty%2FPython%2Fcpython.git SF bug # 557028, illegal use of malloc/free This only applies to 2.2. Use PyMem_Malloc/Free instead of malloc/free. --- diff --git a/Python/compile.c b/Python/compile.c index 6cf13c984794..cdd8b1b3905b 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);