Skip to content

connect_redirect tests leak socket on test failure #5105

@mikeagun

Description

@mikeagun

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.

Metadata

Metadata

Assignees

Labels

P2teststriagedDiscussed in a triage meeting

Type

No type

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions