summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-12 15:58:10 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-12 15:58:10 (GMT)
commitdfaf90da9c4a9a4f7dd7bd716fa0695d32bbd91f (patch)
tree4269725ef8fb44b02584c6c08dc930a662614e05 /Python
parent65a0141e146aba6e2ae2b82d39d016ab03b8c7e2 (diff)
downloadcpython-dfaf90da9c4a9a4f7dd7bd716fa0695d32bbd91f.zip
cpython-dfaf90da9c4a9a4f7dd7bd716fa0695d32bbd91f.tar.gz
cpython-dfaf90da9c4a9a4f7dd7bd716fa0695d32bbd91f.tar.bz2
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 7611b3d..644d9c5 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -28,8 +28,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 */