torture tests revealed that memory was not released correctly when FTP's
connection setup failed an allocation.
Follow-up from
a2d90d4ba5076643b5af9978c4
Closes #17258
if(data->set.str[STRING_FTP_ACCOUNT]) {
ftpc->account = strdup(data->set.str[STRING_FTP_ACCOUNT]);
if(!ftpc->account) {
- free(ftp);
Curl_conn_meta_remove(conn, CURL_META_FTP_CONN);
return CURLE_OUT_OF_MEMORY;
}
strdup(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]);
if(!ftpc->alternative_to_user) {
Curl_safefree(ftpc->account);
- free(ftp);
Curl_conn_meta_remove(conn, CURL_META_FTP_CONN);
return CURLE_OUT_OF_MEMORY;
}