bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)

There was a missing PyMem_Free(format) in time_strftime().
This commit is contained in:
Zackery Spytz 2018-09-21 00:09:48 -06:00 committed by Serhiy Storchaka
parent c510c6b8b6
commit 91e6c8717b
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
Fix a memory leak in Modules/timemodule.c. Patch by Zackery Spytz.

View File

@ -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;
}
}