Skip to content

Commit b42f226

Browse files
x2018bagder
authored andcommitted
libssh: properly free sftp_attributes
Closes curl#19564
1 parent e9a973c commit b42f226

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/vssh/libssh.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,14 +1137,13 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data,
11371137
attrs = sftp_stat(sshc->sftp_session, sshp->path);
11381138
if(attrs) {
11391139
curl_off_t size = attrs->size;
1140+
sftp_attributes_free(attrs);
11401141
if(size < 0) {
11411142
failf(data, "Bad file size (%" FMT_OFF_T ")", size);
11421143
rc = myssh_to_ERROR(data, sshc, CURLE_BAD_DOWNLOAD_RESUME);
11431144
return rc;
11441145
}
1145-
data->state.resume_from = attrs->size;
1146-
1147-
sftp_attributes_free(attrs);
1146+
data->state.resume_from = size;
11481147
}
11491148
else {
11501149
data->state.resume_from = 0;

0 commit comments

Comments
 (0)