Lionel Debroux : kernel32/tests: Fix memory leaks (found by Smatch).
Alexandre Julliard
julliard at winehq.org
Mon Oct 22 09:55:36 CDT 2007
Module: wine
Branch: master
Commit: 938f748b209eed8a6634698f0b98a9514e90541d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=938f748b209eed8a6634698f0b98a9514e90541d
Author: Lionel Debroux <lionel_debroux at yahoo.fr>
Date: Sat Oct 20 21:22:26 2007 +0200
kernel32/tests: Fix memory leaks (found by Smatch).
---
dlls/kernel32/tests/actctx.c | 2 ++
dlls/kernel32/tests/pipe.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 0e687b5..3720f74 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -517,6 +517,7 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl
else
ok(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
strw(info->lpAssemblyDirectoryName));
+ HeapFree(GetProcessHeap(), 0, info);
}
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
if(info->lpFileName)
ok(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
ok(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
+ HeapFree(GetProcessHeap(), 0, info);
}
static HANDLE test_create(const char *file, const char *manifest)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 9150e50..ce0f5b6 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -805,6 +805,7 @@ static void test_CreatePipe(void)
/* 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(CloseHandle(piperead), "CloseHandle for the read pipe failed\n");
+ HeapFree(GetProcessHeap(), 0, buffer);
}
struct named_pipe_client_params
@@ -1022,7 +1023,11 @@ static BOOL are_all_privileges_disabled(HANDLE hToken)
{
Privileges = HeapAlloc(GetProcessHeap(), 0, Size);
ret = GetTokenInformation(hToken, TokenPrivileges, Privileges, Size, &Size);
- if (!ret) return FALSE;
+ if (!ret)
+ {
+ HeapFree(GetProcessHeap(), 0, Privileges);
+ return FALSE;
+ }
}
else
return FALSE;
More information about the wine-cvs
mailing list