[PATCH] winhttp/tests: Fix resource leak.

Andrey Gusev andrey.goosev at gmail.com
Fri Jan 5 06:38:11 CST 2018


Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
---
 dlls/winhttp/tests/notification.c | 3 +++
 dlls/winhttp/tests/winhttp.c      | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c
index da8f8e9bd9..2a647e3633 100644
--- a/dlls/winhttp/tests/notification.c
+++ b/dlls/winhttp/tests/notification.c
@@ -1033,7 +1033,10 @@ START_TEST (notification)
     ret = WaitForSingleObject( si.event, 10000 );
     ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %u\n", GetLastError());
     if (ret != WAIT_OBJECT_0)
+    {
+        CloseHandle(thread);
         return;
+    }
 
     test_persistent_connection( si.port );
 
diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index e06661c31e..4399cf6df4 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -4475,7 +4475,10 @@ START_TEST (winhttp)
     ret = WaitForSingleObject(si.event, 10000);
     ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %u\n", GetLastError());
     if (ret != WAIT_OBJECT_0)
+    {
+        CloseHandle(thread);
         return;
+    }
 
     test_IWinHttpRequest(si.port);
     test_connection_info(si.port);
@@ -4495,4 +4498,5 @@ START_TEST (winhttp)
     test_basic_request(si.port, NULL, quitW);
 
     WaitForSingleObject(thread, 3000);
+    CloseHandle(thread);
 }
-- 
2.13.6




More information about the wine-devel mailing list