From 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Fri, 7 Dec 2018 03:11:30 -0700 Subject: bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) Set MemoryError when appropriate, add missing failure checks, and fix some potential leaks. --- Python/pystrtod.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Python/pystrtod.c') 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; -- cgit v1.2.1