]> granicus.if.org Git - python/commitdiff
Missing DECREFs when exception is raised in sys.excepthook.
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 7 Dec 2001 15:35:35 +0000 (15:35 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 7 Dec 2001 15:35:35 +0000 (15:35 +0000)
Bug fix candidate for 2.1 branch.

(I imagine the other recent leak patches are bug fix candidates, too,
but I forgot to mark mine as such.)

Python/pythonrun.c

index a8ad84503df20a846134321713832515b07c4c7b..4294c9748ef3f400abe925e0d32f35adcd79974a 100644 (file)
@@ -895,6 +895,9 @@ PyErr_PrintEx(int set_sys_last_vars)
                        PyErr_Display(exception2, v2, tb2);
                        PySys_WriteStderr("\nOriginal exception was:\n");
                        PyErr_Display(exception, v, tb);
+                       Py_XDECREF(exception2);
+                       Py_XDECREF(v2);
+                       Py_XDECREF(tb2);
                }
                Py_XDECREF(result);
                Py_XDECREF(args);