Commit db94648d authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed reference leak in the "backslashreplace" error handler.

parent 30f5c350
...@@ -696,8 +696,10 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc) ...@@ -696,8 +696,10 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
ressize += 1+1+2; ressize += 1+1+2;
} }
res = PyUnicode_FromUnicode(NULL, ressize); res = PyUnicode_FromUnicode(NULL, ressize);
if (res==NULL) if (res == NULL) {
Py_DECREF(object);
return NULL; return NULL;
}
for (p = startp+start, outp = PyUnicode_AS_UNICODE(res); for (p = startp+start, outp = PyUnicode_AS_UNICODE(res);
p < startp+end; ++p) { p < startp+end; ++p) {
Py_UNICODE c = *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