8000 bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418) · python/cpython@f37496e · GitHub
[go: up one dir, main page]

Skip to content

Commit f37496e

Browse files
bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)
There was a missing PyMem_Free(format) in time_strftime(). (cherry picked from commit 91e6c87) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 71a9c65 commit f37496e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a memory leak in Modules/timemodule.c. Patch by Zackery Spytz.

Modules/timemodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ time_strftime(PyObject *self, PyObject *args)
654654
if (outbuf[1] == L'y' && buf.tm_year < 0) {
655655
PyErr_SetString(PyExc_ValueError,
656656
"format %y requires year >= 1900 on AIX");
657+
PyMem_Free(format);
657658
return NULL;
658659
}
659660
}

0 commit comments

Comments
 (0)
0