connect_redirect tests leak socket on test failure
In connect_redirect_tests.cpp, authorize_test_wrapper() and
connect_redirect_test_wrapper() allocate client_socket_t* with
new and free with delete after the test body. When FAIL() or
SAFE_REQUIRE() throws, the delete is skipped, leaking the socket
handle and any pending overlapped I/O state.
Additionally, _client_socket has no destructor — ~_base_socket()
closes the Winsock socket but not overlapped.hEvent, so even
normal destruction after a pending receive leaks the event handle.
connect_redirect tests leak socket on test failure
In
connect_redirect_tests.cpp,authorize_test_wrapper()andconnect_redirect_test_wrapper()allocateclient_socket_t*withnewand free withdeleteafter the test body. WhenFAIL()orSAFE_REQUIRE()throws, thedeleteis skipped, leaking the sockethandle and any pending overlapped I/O state.
Additionally,
_client_sockethas no destructor —~_base_socket()closes the Winsock socket but not
overlapped.hEvent, so evennormal destruction after a pending receive leaks the event handle.