From: Daniel Stenberg Date: Tue, 25 Nov 2025 09:14:28 +0000 (+0100) Subject: tool_doswin: clear pointer when thread takes ownership X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6069c340b42a2a4d05f5dc76c49cd3e20e09ccb7;p=thirdparty%2Fcurl.git tool_doswin: clear pointer when thread takes ownership Attempt to address #19675 Closes #19689 --- diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 6204296a8b..cd0ec3b9c1 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -801,10 +801,7 @@ ThreadCleanup: if(socket_w != CURL_SOCKET_BAD) sclose(socket_w); - if(tdata) { - free(tdata); - } - + free(tdata); return 0; } @@ -884,6 +881,7 @@ curl_socket_t win32_stdin_read_thread(void) errorf("CreateThread error: 0x%08lx", GetLastError()); break; } + tdata = NULL; /* win_stdin_thread_func owns it now */ /* Connect to the thread and rearrange our own STDIN handles */ socket_r = CURL_SOCKET(AF_INET, SOCK_STREAM, IPPROTO_TCP);