]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PySymtableEntry_New(): I'm not sure what this routine is doing, but it
authorTim Peters <tim.peters@gmail.com>
Sat, 8 Dec 2001 23:40:38 +0000 (23:40 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 8 Dec 2001 23:40:38 +0000 (23:40 +0000)
was obviously leaking an int object when whatever the heck it's looking for
was found.  Repaired that.  This accounts for why entering function and
class definitions at an interactive prompt leaked a reference to the
integer 1 each time.
Bugfix candidate.

Python/symtable.c

index 74d2b82c3985eb332f6abae39a356adfafa061e0..33e1a579087906a0163de888e99c60c6828e93f8 100644 (file)
@@ -15,6 +15,7 @@ PySymtableEntry_New(struct symtable *st, char *name, int type, int lineno)
                goto fail;
        v = PyDict_GetItem(st->st_symbols, k);
        if (v) /* XXX could check that name, type, lineno match */ {
+               Py_DECREF(k);
                Py_INCREF(v);
                return v;
        }