diff options
author | Guido van Rossum <guido@python.org> | 2001-12-06 21:28:18 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-12-06 21:28:18 +0000 |
commit | 35974fbf31fd2e2a64fd13a6565f1478ed8cfa6e (patch) | |
tree | 297f96e39f954957b203d5ba2767252774dd5b43 /Python | |
parent | sys.platform is now "darwin" without digits appended. (diff) | |
download | cpython-35974fbf31fd2e2a64fd13a6565f1478ed8cfa6e.tar.gz cpython-35974fbf31fd2e2a64fd13a6565f1478ed8cfa6e.tar.bz2 cpython-35974fbf31fd2e2a64fd13a6565f1478ed8cfa6e.zip |
Fix for SF bug #489671 (Neil Norwitz): memory leak in test_richcmp.
Had nothing to do with rich comparisons -- some stack cleanup code was
lost as a result of merging in Neil Schemenauer's generators patch.
Reinserted the stack cleanup code, skipping it when yielding.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 6def4229172..29d70826f2b 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2296,6 +2296,14 @@ eval_frame(PyFrameObject *f) } /* main loop */ + if (why != WHY_YIELD) { + /* Pop remaining stack entries -- but when yielding */ + while (!EMPTY()) { + v = POP(); + Py_XDECREF(v); + } + } + if (why != WHY_RETURN && why != WHY_YIELD) retval = NULL; |