Commit 986fa6d4 authored by Victor Stinner's avatar Victor Stinner

Issue #25349, #26249: Fix memleak in formatfloat()

parent 82328dce
...@@ -438,6 +438,7 @@ formatfloat(PyObject *v, int flags, int prec, int type, ...@@ -438,6 +438,7 @@ formatfloat(PyObject *v, int flags, int prec, int type,
if (str == NULL) if (str == NULL)
return NULL; return NULL;
Py_MEMCPY(str, p, len); Py_MEMCPY(str, p, len);
PyMem_Free(p);
str += len; str += len;
return str; return str;
} }
......
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