diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2025-05-08 11:32:59 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-08 11:32:59 (GMT) |
| commit | e0aefbd263c36b84bc98cd92f3ae3ac871e73bcd (patch) | |
| tree | e585e2412c160b737605caa27365da74d93b3b22 /Python/sysmodule.c | |
| parent | a719e5fbb63346c751fc9dfbc62af32215f6c0be (diff) | |
| download | cpython-e0aefbd263c36b84bc98cd92f3ae3ac871e73bcd.zip cpython-e0aefbd263c36b84bc98cd92f3ae3ac871e73bcd.tar.gz cpython-e0aefbd263c36b84bc98cd92f3ae3ac871e73bcd.tar.bz2 | |
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
(cherry picked from commit 0ec8fc83a83914d2ae97e52529e98ce63aaf831c)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Diffstat (limited to 'Python/sysmodule.c')
| -rw-r--r-- | Python/sysmodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 80d1bf3..4b7f0cc 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1693,6 +1693,9 @@ _sys_getwindowsversion_from_kernel32(void) !GetFileVersionInfoW(kernel32_path, 0, verblock_size, verblock) || !VerQueryValueW(verblock, L"", (LPVOID)&ffi, &ffi_len)) { PyErr_SetFromWindowsErr(0); + if (verblock) { + PyMem_RawFree(verblock); + } return NULL; } |
