diff options
| author | Mark Dickinson <dickinsm@gmail.com> | 2008-07-21 22:49:36 +0000 |
|---|---|---|
| committer | Mark Dickinson <dickinsm@gmail.com> | 2008-07-21 22:49:36 +0000 |
| commit | 623c37d305ce0d770205da586dd3fe094cb52f5c (patch) | |
| tree | 31315fbb03e34bdfa86c88e637befddc2ebad1a8 /Objects/floatobject.c | |
| parent | a46e926de9ffb68eb1af0f0b1a14a3802b76f98d (diff) | |
| download | cpython-623c37d305ce0d770205da586dd3fe094cb52f5c.tar.gz | |
Issue #3369: fix memory leak in floatobject.c. Thanks Kristján Jónsson
for the report and fix.
Diffstat (limited to 'Objects/floatobject.c')
| -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 daf7ee807e..efad21250c 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 |
