From: Viktor Szakats Date: Fri, 31 Oct 2025 02:41:53 +0000 (+0100) Subject: ftp: fix leaking internal buffer `newhost` on error X-Git-Tag: curl-8_17_0~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bf9445315f0964a4848ef08ef0f2bf3ce4c3567;p=thirdparty%2Fcurl.git ftp: fix leaking internal buffer `newhost` on error Pointed out by TIOBE scanner via Coverity 2025.3.0. Closes #19290 --- diff --git a/lib/ftp.c b/lib/ftp.c index 3ac8db6813..4858ae230f 100644 --- 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,