]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref...
authorChristian Heimes <christian@cheimes.de>
Wed, 12 Sep 2012 15:58:10 +0000 (17:58 +0200)
committerChristian Heimes <christian@cheimes.de>
Wed, 12 Sep 2012 15:58:10 +0000 (17:58 +0200)
Python/symtable.c

index 992b5aeb585b33c1ec1b7cf5850bae4415a12623..35fc6e195431c6207a0ad30610bb438d43a13238 100644 (file)
@@ -34,8 +34,10 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
     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 */