mark.dickinson
2008-07-21 22:49:36 UTC
Author: mark.dickinson
Date: Tue Jul 22 00:49:36 2008
New Revision: 65179
Log:
Issue #3369: fix memory leak in floatobject.c. Thanks Kristj?n J?nsson
for the report and fix.
Modified:
python/branches/py3k/Objects/floatobject.c
Modified: python/branches/py3k/Objects/floatobject.c
==============================================================================
--- python/branches/py3k/Objects/floatobject.c (original)
+++ python/branches/py3k/Objects/floatobject.c Tue Jul 22 00:49:36 2008
@@ -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
Date: Tue Jul 22 00:49:36 2008
New Revision: 65179
Log:
Issue #3369: fix memory leak in floatobject.c. Thanks Kristj?n J?nsson
for the report and fix.
Modified:
python/branches/py3k/Objects/floatobject.c
Modified: python/branches/py3k/Objects/floatobject.c
==============================================================================
--- python/branches/py3k/Objects/floatobject.c (original)
+++ python/branches/py3k/Objects/floatobject.c Tue Jul 22 00:49:36 2008
@@ -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