summaryrefslogtreecommitdiffstats
path: root/Modules/parsermodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-11 04:58:43 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-11 04:58:43 (GMT)
commit2cde0eb92267174de1d6371b15432de2555c876b (patch)
treeec8bc651a61b225117879d2d4ef9d341fcc09909 /Modules/parsermodule.c
parent9edcc2e2fd6196886f9e94407833f14c2a854c22 (diff)
downloadcpython-2cde0eb92267174de1d6371b15432de2555c876b.zip
cpython-2cde0eb92267174de1d6371b15432de2555c876b.tar.gz
cpython-2cde0eb92267174de1d6371b15432de2555c876b.tar.bz2
Fix refleaks
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r--Modules/parsermodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index efc7176..66d17b7 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -695,6 +695,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
" found %s",
Py_Type(temp)->tp_name);
Py_DECREF(temp);
+ Py_DECREF(elem);
return 0;
}
if (len == 3) {
@@ -709,6 +710,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
Py_Type(temp)->tp_name);
Py_DECREF(o);
Py_DECREF(temp);
+ Py_DECREF(elem);
return 0;
}
Py_DECREF(o);
@@ -733,10 +735,12 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
}
err = PyNode_AddChild(root, type, strn, *line_num, 0);
if (err == E_NOMEM) {
+ Py_XDECREF(elem);
PyObject_FREE(strn);
return (node *) PyErr_NoMemory();
}
if (err == E_OVERFLOW) {
+ Py_XDECREF(elem);
PyObject_FREE(strn);
PyErr_SetString(PyExc_ValueError,
"unsupported number of child nodes");