diff Python/symtable.c @ 79010:5b64fefbc16b

Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
author Christian Heimes <christian@cheimes.de>
date Wed, 12 Sep 2012 17:58:20 +0200
parents c1b950541e46 99ab7006e466
children 6964a9b6c1ea
line wrap: on
line diff
--- a/Python/symtable.c	Wed Sep 12 17:53:15 2012 +0200
+++ b/Python/symtable.c	Wed Sep 12 17:58:20 2012 +0200
@@ -30,8 +30,10 @@
     if (k == NULL)
         goto fail;
     ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
-    if (ste == NULL)
+    if (ste == NULL) {
+        Py_DECREF(k);
         goto fail;
+    }
     ste->ste_table = st;
     ste->ste_id = k; /* ste owns reference to k */