Skip to content

Commit 2fdf4e7

Browse files
author
Stefan Krah
committed
Move PyErr_NoMemory() closer to the failure.
1 parent a0fd1f5 commit 2fdf4e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/_decimal/_decimal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3108,6 +3108,7 @@ dec_strdup(const char *src, Py_ssize_t size)
31083108
{
31093109
char *dest = PyMem_Malloc(size+1);
31103110
if (dest == NULL) {
3111+
PyErr_NoMemory();
31113112
return NULL;
31123113
}
31133114

@@ -3186,7 +3187,6 @@ dec_format(PyObject *dec, PyObject *args)
31863187
replace_fillchar = 1;
31873188
fmt = dec_strdup(fmt, size);
31883189
if (fmt == NULL) {
3189-
PyErr_NoMemory();
31903190
return NULL;
31913191
}
31923192
fmt[0] = '_';

0 commit comments

Comments
 (0)