[PATCH v2] webservices/tests: Fix resource leak.

Andrey Gusev andrey.goosev at gmail.com
Thu Jan 4 11:10:45 CST 2018


Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
---
 dlls/webservices/tests/channel.c | 4 ++++
 dlls/webservices/tests/proxy.c   | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/webservices/tests/channel.c b/dlls/webservices/tests/channel.c
index 32820fed1f..17a0b58ac8 100644
--- a/dlls/webservices/tests/channel.c
+++ b/dlls/webservices/tests/channel.c
@@ -976,6 +976,7 @@ START_TEST(channel)
     thread = start_listener( &info );
     test_message_read_write( &info );
     WaitForSingleObject( thread, 3000 );
+    CloseHandle(thread);
 
     info.type      = WS_CHANNEL_TYPE_DUPLEX_SESSION;
     info.binding   = WS_TCP_CHANNEL_BINDING;
@@ -984,6 +985,7 @@ START_TEST(channel)
     thread = start_listener( &info );
     test_duplex_session( &info );
     WaitForSingleObject( thread, 3000 );
+    CloseHandle(thread);
 
     info.type      = WS_CHANNEL_TYPE_DUPLEX;
     info.binding   = WS_UDP_CHANNEL_BINDING;
@@ -992,6 +994,7 @@ START_TEST(channel)
     thread = start_listener( &info );
     test_WsAcceptChannel( &info );
     WaitForSingleObject( thread, 3000 );
+    CloseHandle(thread);
 
     info.type    = WS_CHANNEL_TYPE_DUPLEX_SESSION;
     info.binding = WS_TCP_CHANNEL_BINDING;
@@ -999,6 +1002,7 @@ START_TEST(channel)
     thread = start_listener( &info );
     test_WsAcceptChannel( &info );
     WaitForSingleObject( thread, 3000 );
+    CloseHandle(thread);
 
     if (firewall_enabled) set_firewall( APP_REMOVE );
 }
diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c
index bc7ef81db7..95f980a2ff 100644
--- a/dlls/webservices/tests/proxy.c
+++ b/dlls/webservices/tests/proxy.c
@@ -732,7 +732,11 @@ START_TEST(proxy)
 
     ret = WaitForSingleObject( info.event, 3000 );
     ok(ret == WAIT_OBJECT_0, "failed to start test server %u\n", GetLastError());
-    if (ret != WAIT_OBJECT_0) return;
+    if (ret != WAIT_OBJECT_0)
+    {
+        CloseHandle(thread);
+        return;
+    }
 
     test_WsSendMessage( info.port, &test1 );
     test_WsReceiveMessage( info.port );
@@ -741,4 +745,5 @@ START_TEST(proxy)
 
     test_WsSendMessage( info.port, &quit );
     WaitForSingleObject( thread, 3000 );
+    CloseHandle(thread);
 }
-- 
2.13.6




More information about the wine-devel mailing list