mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
This commit is contained in:
parent
45bb5ba61a
commit
0ec8fc83a8
1 changed files with 3 additions and 0 deletions
|
@ -1670,6 +1670,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…
Add table
Add a link
Reference in a new issue