]> granicus.if.org Git - python/commitdiff
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 f0f1d4d07dc2492a0d001b9407827b59c31a77b3..7611b3db6122a7df99ea3c938a4c07514430437c 100644 (file)
@@ -31,7 +31,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);
@@ -75,7 +75,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
 
     return ste;
  fail:
-    Py_XDECREF(k);
     Py_XDECREF(ste);
     return NULL;
 }