From: Guido van Rossum Date: Tue, 9 Dec 1997 14:11:39 +0000 (+0000) Subject: Fix subtle bug in cleanup code in PyErr_NormalizeException(), detected X-Git-Tag: v1.5b2~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19b55f2d17d2a189f9b48844c06d501f25ca6dc5;p=python Fix subtle bug in cleanup code in PyErr_NormalizeException(), detected by Marc Lemburg. There's a path through the code where *val is NULL, but value isn't, and value should be DECREF'ed. --- diff --git a/Python/errors.c b/Python/errors.c index 2a45f0390a..1a643c0fac 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -219,8 +219,8 @@ PyErr_NormalizeException(exc, val, tb) *val = value; return; finally: - Py_DECREF(*exc); - Py_DECREF(*val); + Py_DECREF(type); + Py_DECREF(value); Py_XDECREF(*tb); PyErr_Fetch(exc, val, tb); /* normalize recursively */