Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()
failure (memory allocation failure): raise a MemoryError exception
This commit is contained in:
parent
a992e11fe3
commit
ac470854b8
|
@ -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] = '_';
|
||||
|
|
Loading…
Reference in New Issue