summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 03:08:46 +0200
committerChristian Heimes <christian@cheimes.de>2012-09-10 03:08:46 +0200
commitb6257d526fc6ee7f12a3fe73c1e6f0c0243ef152 (patch)
treee4239b01b1d5b1d738957e925b4c5926ccb8dbef /Python/symtable.c
parent454fcbdff1bb3836df8bea7592819d9539fed271 (diff)
downloadcpython-b6257d526fc6ee7f12a3fe73c1e6f0c0243ef152.tar.gz
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 1ec51f708c..00b342761f 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -28,7 +28,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)
@@ -83,6 +83,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
return ste;
fail:
+ Py_XDECREF(k);
Py_XDECREF(ste);
return NULL;
}