From 6e50724345522dce3f74f076dc2a0662956ba933 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Wed, 7 Jun 2023 19:53:32 +0200 Subject: [PATCH] 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. --- lib/i386-io-windows.h | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.39.2