ftp: fix leaking internal buffer newhost on error

Pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19290
This commit is contained in:
Viktor Szakats 2025-10-31 03:41:53 +01:00
parent d2e8acfaa6
commit 5bf9445315
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -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,