diff options
author | Brett Cannon <bcannon@gmail.com> | 2006-03-02 04:31:55 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2006-03-02 04:31:55 +0000 |
commit | bf5477b0c900ac9417e4ad922e2b2404153c10c2 (patch) | |
tree | e2da9cfb18ed0ec4d092115bdcd96e4899a22bbb /Python/exceptions.c | |
parent | b9ca4028d430cfea8a4651aa250660163a162685 (diff) | |
download | cpython-bf5477b0c900ac9417e4ad922e2b2404153c10c2.tar.gz |
Add a missing Py_DECREF to BaseException__unicode__ .
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r-- | Python/exceptions.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c index c8c7b69d83..560aeb86e0 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 */ |