Commit 938f748b authored by Lionel Debroux's avatar Lionel Debroux Committed by Alexandre Julliard

kernel32/tests: Fix memory leaks (found by Smatch).

parent 5c1334e7
...@@ -517,6 +517,7 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl ...@@ -517,6 +517,7 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl
else else
ok(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n", ok(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
strw(info->lpAssemblyDirectoryName)); strw(info->lpAssemblyDirectoryName));
HeapFree(GetProcessHeap(), 0, info);
} }
static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename) static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename)
...@@ -560,6 +561,7 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil ...@@ -560,6 +561,7 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil
if(info->lpFileName) if(info->lpFileName)
ok(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n"); ok(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
ok(info->lpFilePath == NULL, "info->lpFilePath != NULL\n"); ok(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
HeapFree(GetProcessHeap(), 0, info);
} }
static HANDLE test_create(const char *file, const char *manifest) static HANDLE test_create(const char *file, const char *manifest)
......
...@@ -805,6 +805,7 @@ static void test_CreatePipe(void) ...@@ -805,6 +805,7 @@ static void test_CreatePipe(void)
/* But now we need to get informed that the pipe is closed */ /* But now we need to get informed that the pipe is closed */
ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL) == 0, "Broken pipe not detected\n"); ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL) == 0, "Broken pipe not detected\n");
ok(CloseHandle(piperead), "CloseHandle for the read pipe failed\n"); ok(CloseHandle(piperead), "CloseHandle for the read pipe failed\n");
HeapFree(GetProcessHeap(), 0, buffer);
} }
struct named_pipe_client_params struct named_pipe_client_params
...@@ -1022,7 +1023,11 @@ static BOOL are_all_privileges_disabled(HANDLE hToken) ...@@ -1022,7 +1023,11 @@ static BOOL are_all_privileges_disabled(HANDLE hToken)
{ {
Privileges = HeapAlloc(GetProcessHeap(), 0, Size); Privileges = HeapAlloc(GetProcessHeap(), 0, Size);
ret = GetTokenInformation(hToken, TokenPrivileges, Privileges, Size, &Size); ret = GetTokenInformation(hToken, TokenPrivileges, Privileges, Size, &Size);
if (!ret) return FALSE; if (!ret)
{
HeapFree(GetProcessHeap(), 0, Privileges);
return FALSE;
}
} }
else else
return FALSE; return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment