summaryrefslogtreecommitdiff
path: root/Python/pystrtod.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r--Python/pystrtod.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 98aa9ba48b..02a3fb5780 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -398,6 +398,9 @@ _Py_string_to_number_with_underscores(
}
dup = PyMem_Malloc(orig_len + 1);
+ if (dup == NULL) {
+ return PyErr_NoMemory();
+ }
end = dup;
prev = '\0';
last = s + orig_len;