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.
This commit is contained in:
Guido van Rossum 1997-12-09 14:11:39 +00:00
parent a2e268aa40
commit 19b55f2d17

View File

@ -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 */