Fixed memory leak in error branch of formatfloat(). CID 719687
This commit is contained in:
parent
be232923e4
commit
fd30236494
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue