From: Christian Heimes Date: Mon, 10 Sep 2012 01:08:46 +0000 (+0200) Subject: Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in... X-Git-Tag: v2.7.4rc1~580 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c1bce00d25ddda20d4e760e5771324865ddae17;p=thirdparty%2FPython%2Fcpython.git Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases --- diff --git a/Python/symtable.c b/Python/symtable.c index 51b59f0310d8..f0f1d4d07dc2 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -22,7 +22,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, void *key, int lineno) { PySTEntryObject *ste = NULL; - PyObject *k; + PyObject *k = NULL; k = PyLong_FromVoidPtr(key); if (k == NULL) @@ -75,6 +75,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, return ste; fail: + Py_XDECREF(k); Py_XDECREF(ste); return NULL; }