[Python-3000-checkins] r65179 - python/branches/py3k/Objects/floatobject.c

mark.dickinson python-3000-checkins at python.org
Tue Jul 22 00:49:36 CEST 2008


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


More information about the Python-3000-checkins mailing list