From: Christian Heimes Date: Wed, 12 Sep 2012 15:58:10 +0000 (+0200) Subject: Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref... X-Git-Tag: v3.2.4rc1~533 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55ad6515c90148bbcaeee0d7a185bfecc9aa1693;p=thirdparty%2FPython%2Fcpython.git 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 992b5aeb585b..35fc6e195431 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 */