tool_doswin: clear pointer when thread takes ownership

Attempt to address #19675
Closes #19689
This commit is contained in:
Daniel Stenberg 2025-11-25 10:14:28 +01:00
parent b8f83738c3
commit 6069c340b4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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);