comparison Python/errors.c @ 6789:bb440a2975ab legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Tue, 09 Dec 1997 14:11:39 +0000
parents 4cb223f29337
children ca1c669bb041
comparison
equal deleted inserted replaced
6788:ceabd50317e3 6789:bb440a2975ab
217 } 217 }
218 *exc = type; 218 *exc = type;
219 *val = value; 219 *val = value;
220 return; 220 return;
221 finally: 221 finally:
222 Py_DECREF(*exc); 222 Py_DECREF(type);
223 Py_DECREF(*val); 223 Py_DECREF(value);
224 Py_XDECREF(*tb); 224 Py_XDECREF(*tb);
225 PyErr_Fetch(exc, val, tb); 225 PyErr_Fetch(exc, val, tb);
226 /* normalize recursively */ 226 /* normalize recursively */
227 PyErr_NormalizeException(exc, val, tb); 227 PyErr_NormalizeException(exc, val, tb);
228 } 228 }