diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-12 15:58:20 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-12 15:58:20 (GMT) |
commit | 10ca1fee8f293af317cbcca0f38b15a300036b7b (patch) | |
tree | 53a95e36bbc16c3596665c45f16e0e3eb9552340 /Python/symtable.c | |
parent | 9c5b521c715d7f369413d054b68edbca8eef41e4 (diff) | |
parent | 55ad6515c90148bbcaeee0d7a185bfecc9aa1693 (diff) | |
download | cpython-10ca1fee8f293af317cbcca0f38b15a300036b7b.zip cpython-10ca1fee8f293af317cbcca0f38b15a300036b7b.tar.gz cpython-10ca1fee8f293af317cbcca0f38b15a300036b7b.tar.bz2 |
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 36f59ae..1c291bb 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -30,8 +30,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 */ |