cf-socket: return OOM error if socket() failes due to OOM

Closes #20100
This commit is contained in:
Daniel Stenberg 2025-12-26 11:00:00 +01:00
parent 7032982896
commit 19ca87d4e2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -346,6 +346,8 @@ static CURLcode socket_open(struct Curl_easy *data,
else {
/* opensocket callback not set, so simply create the socket now */
*sockfd = CURL_SOCKET(addr->family, addr->socktype, addr->protocol);
if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
return CURLE_OUT_OF_MEMORY;
}
if(*sockfd == CURL_SOCKET_BAD) {