summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2013-11-08 17:05:02 (GMT)
committerStefan Krah <skrah@bytereef.org>2013-11-08 17:05:02 (GMT)
commit2fdf4e7b9b30e2e7cae87a01334fca8e6b49eff2 (patch)
treefc4d500e8422b4ff2d1fa541cbf7e0f657f878b1
parenta0fd1f5a187a001650ade75fbfe97418705beff8 (diff)
downloadcpython-2fdf4e7b9b30e2e7cae87a01334fca8e6b49eff2.zip
cpython-2fdf4e7b9b30e2e7cae87a01334fca8e6b49eff2.tar.gz
cpython-2fdf4e7b9b30e2e7cae87a01334fca8e6b49eff2.tar.bz2
Move PyErr_NoMemory() closer to the failure.
-rw-r--r--Modules/_decimal/_decimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index aec3949..06c2c39 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3108,6 +3108,7 @@ dec_strdup(const char *src, Py_ssize_t size)
{
char *dest = PyMem_Malloc(size+1);
if (dest == NULL) {
+ PyErr_NoMemory();
return NULL;
}
@@ -3186,7 +3187,6 @@ dec_format(PyObject *dec, PyObject *args)
replace_fillchar = 1;
fmt = dec_strdup(fmt, size);
if (fmt == NULL) {
- PyErr_NoMemory();
return NULL;
}
fmt[0] = '_';