]> 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 1ec51f708c358831d1d23343763edd08ea993ee2..00b342761f0c302f4d966a42b03a1645ec3d860b 100644 (file)
@@ -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;
 }