From 9ccce0ce645f089063ed61bec53644a138ac0a37 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Wed, 10 Jan 2018 23:44:25 +0100 Subject: [PATCH] advapi32/tests: Fix a couple of leaks (Valgrind). Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/advapi32/tests/security.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index a7101742b5e..57889dc402d 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -6571,6 +6571,8 @@ static void test_system_security_access(void) /* privilege is checked on access */ err = GetSecurityInfo( hkey, SE_REGISTRY_KEY, SACL_SECURITY_INFORMATION, NULL, NULL, NULL, &sacl, &sd ); todo_wine ok( err == ERROR_PRIVILEGE_NOT_HELD, "got %u\n", err ); + if (err == ERROR_SUCCESS) + LocalFree( sd ); priv.PrivilegeCount = 1; priv.Privileges[0].Luid = luid; @@ -7085,6 +7087,7 @@ static void test_token_security_descriptor(void) CloseHandle(info.hThread); LocalFree(acl_child); + HeapFree(GetProcessHeap(), 0, sd2); LocalFree(psid); CloseHandle(token3);