summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/floatobject.c6
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