mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
sftp: Avoid leaking sftp attributes when opening file
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
@@ -1917,12 +1917,14 @@ sftp_file sftp_open(sftp_session sftp,
|
||||
ssh_set_error(sftp->session,
|
||||
SSH_FATAL,
|
||||
"Cannot open in append mode. Unknown file size.");
|
||||
sftp_attributes_free(stat_data);
|
||||
sftp_close(handle);
|
||||
sftp_set_error(sftp, SSH_FX_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
handle->offset = stat_data->size;
|
||||
sftp_attributes_free(stat_data);
|
||||
}
|
||||
return handle;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user