commit | 55ad6515c90148bbcaeee0d7a185bfecc9aa1693 | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Wed Sep 12 17:58:10 2012 +0200 |
committer | Christian Heimes <christian@cheimes.de> | Wed Sep 12 17:58:10 2012 +0200 |
tree | b7a935b80bda06b0d0513c16bcac761d43cbfc3a | |
parent | 1526582df686a66e15c1944aed13c2ea6b922882 [diff] |
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
diff --git a/Python/symtable.c b/Python/symtable.c index 992b5ae..35fc6e1 100644 --- a/Python/symtable.c +++ b/Python/symtable.c
@@ -34,8 +34,10 @@ 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 */