]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport 2.9:
authorAnthony Baxter <anthonybaxter@gmail.com>
Fri, 21 Dec 2001 03:45:15 +0000 (03:45 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Fri, 21 Dec 2001 03:45:15 +0000 (03:45 +0000)
 PySymtableEntry_New():  I'm not sure what this
 routine is doing, but it 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.

Python/symtable.c

index aed8908bb212d6bb24aa3be01caa654a168b5dcc..42e2887e7dc9dcb5669d8fe94046e9b569ad7534 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;
        }