Partly revert ad3824a90261 and add comment about reference ownership
authorChristian Heimes <christian@cheimes.de>
Wed, 12 Sep 2012 15:52:46 +0000 (17:52 +0200)
committerChristian Heimes <christian@cheimes.de>
Wed, 12 Sep 2012 15:52:46 +0000 (17:52 +0200)
Python/symtable.c

index 00b342761f0c302f4d966a42b03a1645ec3d860b..992b5aeb585b33c1ec1b7cf5850bae4415a12623 100644 (file)
@@ -37,7 +37,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
     if (ste == NULL)
         goto fail;
     ste->ste_table = st;
-    ste->ste_id = k;
+    ste->ste_id = k; /* ste owns reference to k */
 
     ste->ste_name = name;
     Py_INCREF(name);
@@ -83,7 +83,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
 
     return ste;
  fail:
-    Py_XDECREF(k);
     Py_XDECREF(ste);
     return NULL;
 }