mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue