summaryrefslogtreecommitdiffstats
path: root/Parser/parser.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-10 06:42:25 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-10 06:42:25 (GMT)
commit2c4e4f98397bcc591ad3a551e1e57cea0e2bd986 (patch)
treef200b67e22e157d409945e29f400e9766eb61beb /Parser/parser.c
parent65c05b20e97a493b917fa71f10535512c713c662 (diff)
downloadcpython-2c4e4f98397bcc591ad3a551e1e57cea0e2bd986.zip
cpython-2c4e4f98397bcc591ad3a551e1e57cea0e2bd986.tar.gz
cpython-2c4e4f98397bcc591ad3a551e1e57cea0e2bd986.tar.bz2
SF patch #1467512, fix double free with triple quoted string in standard build.
This was the result of inconsistent use of PyMem_* and PyObject_* allocators. By changing to use PyObject_* allocator almost everywhere, this removes the inconsistency.
Diffstat (limited to 'Parser/parser.c')
-rw-r--r--Parser/parser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Parser/parser.c b/Parser/parser.c
index ada6be2..45b613a 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -75,7 +75,7 @@ PyParser_New(grammar *g, int start)
if (!g->g_accel)
PyGrammar_AddAccelerators(g);
- ps = PyMem_NEW(parser_state, 1);
+ ps = PyMem_MALLOC(sizeof(parser_state));
if (ps == NULL)
return NULL;
ps->p_grammar = g;
@@ -84,7 +84,7 @@ PyParser_New(grammar *g, int start)
#endif
ps->p_tree = PyNode_New(start);
if (ps->p_tree == NULL) {
- PyMem_DEL(ps);
+ PyMem_FREE(ps);
return NULL;
}
s_reset(&ps->p_stack);
@@ -98,7 +98,7 @@ PyParser_Delete(parser_state *ps)
/* NB If you want to save the parse tree,
you must set p_tree to NULL before calling delparser! */
PyNode_Free(ps->p_tree);
- PyMem_DEL(ps);
+ PyMem_FREE(ps);
}