summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 01:09:17 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 01:09:17 (GMT)
commit310f81449a5d95d4d30a17a348929cb91b6e8307 (patch)
treecaaa6e9bcba337c2d5078fdb315e4fd9baf92076 /Python/symtable.c
parent455657961e78d0019bb789ccd0b5f5a94a262e18 (diff)
parent837e53a7c268215bb521a5b0ce765367ca0704da (diff)
downloadcpython-310f81449a5d95d4d30a17a348929cb91b6e8307.zip
cpython-310f81449a5d95d4d30a17a348929cb91b6e8307.tar.gz
cpython-310f81449a5d95d4d30a17a348929cb91b6e8307.tar.bz2
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index a0b786b..d2bb889 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -24,7 +24,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
void *key, int lineno, int col_offset)
{
PySTEntryObject *ste = NULL;
- PyObject *k;
+ PyObject *k = NULL;
k = PyLong_FromVoidPtr(key);
if (k == NULL)
@@ -79,6 +79,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
return ste;
fail:
+ Py_XDECREF(k);
Py_XDECREF(ste);
return NULL;
}