]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: fix leaking internal buffer `newhost` on error
authorViktor Szakats <commit@vsz.me>
Fri, 31 Oct 2025 02:41:53 +0000 (03:41 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 31 Oct 2025 12:14:09 +0000 (13:14 +0100)
Pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19290

lib/ftp.c

index 3ac8db6813bb48621b929aeeed4e6b10302f85fe..4858ae230f14526f5650fbb4e72402b79e0e896c 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1925,7 +1925,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
     result = Curl_conn_get_ip_info(data, data->conn, FIRSTSOCKET,
                                    &is_ipv6, &ipquad);
     if(result)
-      return result;
+      goto error;
 
     (void)Curl_resolv_blocking(data, host_name, ipquad.remote_port,
                                is_ipv6 ? CURL_IPRESOLVE_V6 : CURL_IPRESOLVE_V4,