mirror of https://github.com/python/cpython.git
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
(cherry picked from commit 0ec8fc83a8
)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
This commit is contained in:
parent
a719e5fbb6
commit
e0aefbd263
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue