← Commit list

0ccd16d29a

Daniel Stenberg
Daniel Stenberg
2025-12-27
SUCCESS Duration: 202s

Subject

ftp: return from ftp_state_use_port immediately on OOM

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/ftp.c+6 -2
@@ -1026,8 +1026,12 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
/* step 2, create a socket for the requested address */
error = 0;
for(ai = res; ai; ai = ai->ai_next) {
- if(Curl_socket_open(data, ai, NULL,
- Curl_conn_get_transport(data, conn), &portsock)) {
+ result = Curl_socket_open(data, ai, NULL,
+ Curl_conn_get_transport(data, conn), &portsock);
+ if(result) {
+ if(result == CURLE_OUT_OF_MEMORY)
+ goto out;
+ result = CURLE_FTP_PORT_FAILED;
error = SOCKERRNO;
continue;
}