summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-03-02 04:31:55 (GMT)
committerBrett Cannon <bcannon@gmail.com>2006-03-02 04:31:55 (GMT)
commit46872b16135c8c9c9139687ca23df4545c1b79f2 (patch)
tree88a11b67e37dd36a1fc76085f4dddb1279b15fe4 /Python
parent5bde08dba3a34de7f625420035f1d0876bc71f39 (diff)
downloadcpython-46872b16135c8c9c9139687ca23df4545c1b79f2.zip
cpython-46872b16135c8c9c9139687ca23df4545c1b79f2.tar.gz
cpython-46872b16135c8c9c9139687ca23df4545c1b79f2.tar.bz2
Add a missing Py_DECREF to BaseException__unicode__ .
Diffstat (limited to 'Python')
-rw-r--r--Python/exceptions.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c
index c8c7b69..560aeb8 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -285,16 +285,22 @@ BaseException__unicode__(PyObject *self, PyObject *args)
}
else if (args_len == 1) {
PyObject *temp = PySequence_GetItem(args, 0);
+ PyObject *unicode_obj;
+
if (!temp) {
Py_DECREF(args);
return NULL;
}
Py_DECREF(args);
- return PyObject_Unicode(temp);
+ unicode_obj = PyObject_Unicode(temp);
+ Py_DECREF(temp);
+ return unicode_obj;
}
else {
+ PyObject *unicode_obj = PyObject_Unicode(args);
+
Py_DECREF(args);
- return PyObject_Unicode(args);
+ return unicode_obj;
}
}
#endif /* Py_USING_UNICODE */