diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-08-10 10:11:43 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-08-10 10:11:43 (GMT) |
commit | 36f938fbdf66e414c8e0c743246dc306c6b9c452 (patch) | |
tree | f47e0b2ef378c666592854c6d2f90fcf7f168d88 | |
parent | cccc58d993a885aea726c55990b587d57ca1ed2d (diff) | |
download | cpython-36f938fbdf66e414c8e0c743246dc306c6b9c452.zip cpython-36f938fbdf66e414c8e0c743246dc306c6b9c452.tar.gz cpython-36f938fbdf66e414c8e0c743246dc306c6b9c452.tar.bz2 |
Fix refleak: decref inputobj after extracting the relavant info (the object
won't go away, as the exception object holds another reference).
-rw-r--r-- | Objects/unicodeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 98147e8..8288f1e 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1323,6 +1323,9 @@ int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler *input = PyBytes_AS_STRING(inputobj); insize = PyBytes_GET_SIZE(inputobj); *inend = *input + insize; + /* we can DECREF safely, as the exception has another reference, + so the object won't go away. */ + Py_DECREF(inputobj); if (newpos<0) newpos = insize+newpos; |