Skip to content

Commit e0aefbd

Browse files
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
(cherry picked from commit 0ec8fc8) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
1 parent a719e5f commit e0aefbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Python/sysmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,9 @@ _sys_getwindowsversion_from_kernel32(void)
16931693
!GetFileVersionInfoW(kernel32_path, 0, verblock_size, verblock) ||
16941694
!VerQueryValueW(verblock, L"", (LPVOID)&ffi, &ffi_len)) {
16951695
PyErr_SetFromWindowsErr(0);
1696+
if (verblock) {
1697+
PyMem_RawFree(verblock);
1698+
}
16961699
return NULL;
16971700
}
16981701

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy