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