From 5485189eb0d23167de3251fd4b84de70458a9815 Mon Sep 17 00:00:00 2001 From: Andrey Gusev Date: Thu, 4 Jan 2018 19:10:45 +0200 Subject: [PATCH] webservices/tests: Fix resource leak. Signed-off-by: Andrey Gusev Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- 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 32820fed1f4..17a0b58ac85 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 bc7ef81db7d..95f980a2ff4 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); }