summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-12-09 14:11:39 +0000
committerGuido van Rossum <guido@python.org>1997-12-09 14:11:39 +0000
commit45c68f0d1a1291b7a3754bc6c2bb69a554165a0f (patch)
tree4fb5f63c3cf8383bc12796b28f16488924c4b6af /Python/errors.c
parentad994c6a1c17b223987356ba621ed979dc9459ab (diff)
downloadcpython-45c68f0d1a1291b7a3754bc6c2bb69a554165a0f.tar.gz
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.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c4
1 files changed, 2 insertions, 2 deletions
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 */