[Python-checkins] bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)
Serhiy Storchaka
webhook-mailer at python.org
Fri Sep 21 02:09:51 EDT 2018
https://github.com/python/cpython/commit/91e6c8717b7dcbcc46b189509de5f2d335819f37
commit: 91e6c8717b7dcbcc46b189509de5f2d335819f37
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2018-09-21T09:09:48+03:00
summary:
bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)
There was a missing PyMem_Free(format) in time_strftime().
files:
A Misc/NEWS.d/next/Core and Builtins/2018-09-19-06-57-34.bpo-34735.-3mrSJ.rst
M Modules/timemodule.c
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-19-06-57-34.bpo-34735.-3mrSJ.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-19-06-57-34.bpo-34735.-3mrSJ.rst
new file mode 100644
index 000000000000..8de08ec38637
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-19-06-57-34.bpo-34735.-3mrSJ.rst
@@ -0,0 +1 @@
+Fix a memory leak in Modules/timemodule.c. Patch by Zackery Spytz.
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index d162d93c9c63..f41d6fab95ba 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -801,6 +801,7 @@ time_strftime(PyObject *self, PyObject *args)
if (outbuf[1] == L'y' && buf.tm_year < 0) {
PyErr_SetString(PyExc_ValueError,
"format %y requires year >= 1900 on AIX");
+ PyMem_Free(format);
return NULL;
}
}
More information about the Python-checkins
mailing list