diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/floatobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index daf7ee8..efad212 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -223,13 +223,19 @@ PyFloat_FromString(PyObject *v) p++; } if (PyOS_strnicmp(p, "inf", 4) == 0) { + if (s_buffer != NULL) + PyMem_FREE(s_buffer); Py_RETURN_INF(sign); } if (PyOS_strnicmp(p, "infinity", 9) == 0) { + if (s_buffer != NULL) + PyMem_FREE(s_buffer); Py_RETURN_INF(sign); } #ifdef Py_NAN if(PyOS_strnicmp(p, "nan", 4) == 0) { + if (s_buffer != NULL) + PyMem_FREE(s_buffer); Py_RETURN_NAN; } #endif |