diff Python/compile.c @ 24741:e756867ace81 2.2

SF bug # 557028, illegal use of malloc/free This only applies to 2.2. Use PyMem_Malloc/Free instead of malloc/free.
author Neal Norwitz <nnorwitz@gmail.com>
date Sun, 11 Aug 2002 15:40:35 +0000
parents d4406fbfcb4e
children a94f272e600d
line wrap: on
line diff
--- a/Python/compile.c	Fri Aug 09 20:41:19 2002 +0000
+++ b/Python/compile.c	Sun Aug 11 15:40:35 2002 +0000
@@ -1958,7 +1958,7 @@
 			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 @@
 			}
 			s[0] = '-';
 			strcpy(s + 1, STR(pnum));
-			free(STR(pnum));
+			PyMem_Free(STR(pnum));
 			STR(pnum) = s;
 		}
 		com_atom(c, patom);