Kaydet (Commit) 34f7383d authored tarafından Victor Stinner's avatar Victor Stinner

Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()

failure (memory allocation failure): raise a MemoryError exception
üst f866f97c
......@@ -3187,6 +3187,7 @@ dec_format(PyObject *dec, PyObject *args)
replace_fillchar = 1;
fmt = dec_strdup(fmt, size);
if (fmt == NULL) {
PyErr_NoMemory();
return NULL;
}
fmt[0] = '_';
......
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