summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-10-29 19:33:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-10-29 19:33:14 (GMT)
commitac470854b8121ce4b5dc9388c9ad084f5359b2aa (patch)
treed9e2f52d3bca557b66c6600ba287e4de1fdd5243 /Modules/_decimal
parenta992e11fe36b8461d3064a7cc37552a44c7dd022 (diff)
downloadcpython-ac470854b8121ce4b5dc9388c9ad084f5359b2aa.zip
cpython-ac470854b8121ce4b5dc9388c9ad084f5359b2aa.tar.gz
cpython-ac470854b8121ce4b5dc9388c9ad084f5359b2aa.tar.bz2
Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()
failure (memory allocation failure): raise a MemoryError exception
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/_decimal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 628b2f7..6f9e9de 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -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] = '_';