Commit fd302364 authored by Christian Heimes's avatar Christian Heimes

Fixed memory leak in error branch of formatfloat(). CID 719687

parent be232923
......@@ -13237,8 +13237,10 @@ formatfloat(PyObject *v, int flags, int prec, int type,
return -1;
len = strlen(p);
if (writer) {
if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1)
if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1) {
PyMem_Free(p);
return -1;
}
unicode_write_cstr(writer->buffer, writer->pos, p, len);
writer->pos += len;
}
......
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