From: x2018 Date: Mon, 17 Nov 2025 10:36:42 +0000 (+0800) Subject: libssh: properly free sftp_attributes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b42f226b94409defd7487347b543911f18eb1468;p=thirdparty%2Fcurl.git libssh: properly free sftp_attributes Closes #19564 --- diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 8653c4901d..9428a20a5f 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1137,14 +1137,13 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data, attrs = sftp_stat(sshc->sftp_session, sshp->path); if(attrs) { curl_off_t size = attrs->size; + sftp_attributes_free(attrs); if(size < 0) { failf(data, "Bad file size (%" FMT_OFF_T ")", size); rc = myssh_to_ERROR(data, sshc, CURLE_BAD_DOWNLOAD_RESUME); return rc; } - data->state.resume_from = attrs->size; - - sftp_attributes_free(attrs); + data->state.resume_from = size; } else { data->state.resume_from = 0;