From 13f10b2fe0ee03ea47a26d9c8b9f032bc58e16d8 Mon Sep 17 00:00:00 2001 From: 11soda11 <115734183+Sodastream11@users.noreply.github.com> Date: Tue, 28 Jul 2026 04:16:11 +0200 Subject: [PATCH] second try with atexit --- src/tool_doswin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 6333464460..390d0aba91 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -730,7 +730,6 @@ static DWORD WINAPI win_stdin_thread_func(void *thread_data) { (void)thread_data; - atexit(cleanup_tdata); for(;;) { DWORD n; @@ -834,6 +833,12 @@ curl_socket_t win32_stdin_read_thread(void) curl_socklen_t socksize = 0; struct sockaddr_in selfaddr; + /* prevent mem leak warnings */ + if(atexit(&cleanup_tdata)) { + errorf("atexit() error"); + break; + } + /* Create the listening socket. It is used to create the writing socket by * accepting a connection from the reading socket. */ socket_l = CURL_SOCKET(AF_INET, SOCK_STREAM, IPPROTO_TCP);