Sven Baars : ntoskrnl.exe/tests: Fix some memory leaks (Valgrind).

Alexandre Julliard julliard at winehq.org
Thu Jan 17 16:08:48 CST 2019


Module: wine
Branch: master
Commit: 26db17e90df14632057611ac03c0fdebb7def261
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=26db17e90df14632057611ac03c0fdebb7def261

Author: Sven Baars <sven.wine at gmail.com>
Date:   Thu Jan 17 17:42:39 2019 +0100

ntoskrnl.exe/tests: Fix some memory leaks (Valgrind).

Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntoskrnl.exe/tests/ntoskrnl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
index 2dc86ee..c17da7f 100644
--- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
@@ -33,6 +33,7 @@
 static HANDLE device;
 
 static BOOL     (WINAPI *pRtlDosPathNameToNtPathName_U)( LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR* );
+static BOOL     (WINAPI *pRtlFreeUnicodeString)( PUNICODE_STRING );
 
 static void load_resource(const char *name, char *filename)
 {
@@ -177,6 +178,8 @@ static void main_test(void)
     } while (read == sizeof(buffer));
     winetest_add_failures(new_failures);
 
+    pRtlFreeUnicodeString(&pathU);
+    heap_free(test_input);
     CloseHandle(okfile);
     DeleteFileW(pathW);
 }
@@ -249,6 +252,7 @@ START_TEST(ntoskrnl)
 
     HMODULE hntdll = GetModuleHandleA("ntdll.dll");
     pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");
+    pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString");
 
     if (!(service = load_driver(filename, "driver.dll", "WineTestDriver")))
         return;




More information about the wine-cvs mailing list