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: v3.2.4rc1~550 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=837e53a7c268215bb521a5b0ce765367ca0704da;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 1ec51f708c35..00b342761f0c 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -28,7 +28,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, void *key, int lineno, int col_offset) { PySTEntryObject *ste = NULL; - PyObject *k; + PyObject *k = NULL; k = PyLong_FromVoidPtr(key); if (k == NULL) @@ -83,6 +83,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, return ste; fail: + Py_XDECREF(k); Py_XDECREF(ste); return NULL; }