commit | 7d96a09aca160f721820c2a63fcd3bfe100c050e | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Tue Sep 23 19:58:57 2014 +0300 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Tue Sep 23 19:58:57 2014 +0300 |
tree | 0f070cfc0263120119dff3f1f0a3e69f52c71e59 | |
parent | 70d92556ebeeb71728e30be862a8c72b3d753024 [diff] |
Fixed reference leak in the "backslashreplace" error handler.
diff --git a/Python/codecs.c b/Python/codecs.c index 69498c4..7d1145f 100644 --- a/Python/codecs.c +++ b/Python/codecs.c
@@ -696,8 +696,10 @@ ressize += 1+1+2; } res = PyUnicode_FromUnicode(NULL, ressize); - if (res==NULL) + if (res == NULL) { + Py_DECREF(object); return NULL; + } for (p = startp+start, outp = PyUnicode_AS_UNICODE(res); p < startp+end; ++p) { Py_UNICODE c = *p;