diff options
author | Pali Rohár <pali@kernel.org> | 2023-06-07 19:53:32 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2023-12-29 14:30:02 +0100 |
commit | 6e50724345522dce3f74f076dc2a0662956ba933 (patch) | |
tree | 16196bf8396c658f591a0079568116b3114c600d | |
parent | 2be154f7350826f3e08cc7425e761946ed039fab (diff) | |
download | pciutils-6e50724345522dce3f74f076dc2a0662956ba933.tar.gz |
libpci: i386-io-windows.h: Fix memory leak in grant_process_token_dacl_permissions()
When SetEntriesInAcl() call success then new_dacl allocated by this
function has to be released by LocalFree() call.
-rw-r--r-- | lib/i386-io-windows.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index 8089d19..73af883 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -592,12 +592,14 @@ grant_process_token_dacl_permissions(HANDLE process, DWORD permissions, HANDLE * if (MySetSecurityInfo(*token, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, new_dacl, NULL) != ERROR_SUCCESS) { + LocalFree(new_dacl); LocalFree(*security_descriptor); LocalFree(owner); CloseHandle(*token); return FALSE; } + LocalFree(new_dacl); LocalFree(owner); return TRUE; } |