summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-12 17:58:10 +0200
committerChristian Heimes <christian@cheimes.de>2012-09-12 17:58:10 +0200
commitd5b804cccce865c5bde533ce79b32c6509a2a7b5 (patch)
tree99853b27b2f10856f105c5b8a49caff903a2aa42 /Python
parentc99ce12e0b7abb2b188c0577598abac5d5e69cfe (diff)
downloadcpython-d5b804cccce865c5bde533ce79b32c6509a2a7b5.tar.gz
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 992b5aeb58..35fc6e1954 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -34,8 +34,10 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
if (k == NULL)
goto fail;
ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
- if (ste == NULL)
+ if (ste == NULL) {
+ Py_DECREF(k);
goto fail;
+ }
ste->ste_table = st;
ste->ste_id = k; /* ste owns reference to k */