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:
Victor Stinner 2013-10-29 20:33:14 +01:00
parent a992e11fe3
commit ac470854b8
1 changed files with 1 additions and 0 deletions

View File

@ -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] = '_';