]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in...
authorChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 01:08:46 +0000 (03:08 +0200)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 01:08:46 +0000 (03:08 +0200)
Python/symtable.c

index 51b59f0310d8d75916e4bbe055a72d9d8af9a612..f0f1d4d07dc2492a0d001b9407827b59c31a77b3 100644 (file)
@@ -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;
 }