summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMoshe Zadka <moshez@math.huji.ac.il>2001-01-11 11:55:37 (GMT)
committerMoshe Zadka <moshez@math.huji.ac.il>2001-01-11 11:55:37 (GMT)
commitf5df3834eb83dc388f332a8e0b115bd4bef97728 (patch)
treeb83599489dc0d3c9d881c3b1c67c9a390debbb75 /Python/ceval.c
parentab78beca2fb7842f0419d0dc34874a2d30b7467b (diff)
downloadcpython-f5df3834eb83dc388f332a8e0b115bd4bef97728.zip
cpython-f5df3834eb83dc388f332a8e0b115bd4bef97728.tar.gz
cpython-f5df3834eb83dc388f332a8e0b115bd4bef97728.tar.bz2
Fixed bugs noted by Greg Stein
* x wasn't initialized to NULL * Did not DECREF result from displayhook function
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 8012b83..347a541 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1250,6 +1250,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
PyErr_SetString(PyExc_RuntimeError,
"lost sys.displayhook");
err = -1;
+ x = NULL;
}
if (err == 0) {
x = Py_BuildValue("(O)", v);
@@ -1258,6 +1259,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
}
if (err == 0) {
w = PyEval_CallObject(w, x);
+ Py_XDECREF(w);
if (w == NULL)
err = -1;
}