Issue #3369: fix memory leak in floatobject.c. Thanks Kristján Jónsson
for the report and fix.
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 @@
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