Commit 7d96a09a authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed reference leak in the "backslashreplace" error handler.

parent 70d92556
......@@ -696,8 +696,10 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment