diff Python/symtable.c @ 78943:ad3824a90261 3.2

Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
author Christian Heimes <christian@cheimes.de>
date Mon, 10 Sep 2012 03:08:46 +0200
parents 1e0e821d2626
children 2888356cdd4e a29854168241
line wrap: on
line diff
--- a/Python/symtable.c	Mon Sep 10 03:00:14 2012 +0200
+++ b/Python/symtable.c	Mon Sep 10 03:08:46 2012 +0200
@@ -28,7 +28,7 @@
         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 @@
 
     return ste;
  fail:
+    Py_XDECREF(k);
     Py_XDECREF(ste);
     return NULL;
 }