mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
Improve sftp_close().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@599 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -1318,18 +1318,18 @@ int sftp_file_close(SFTP_FILE *file) {
|
||||
/* Close an open file handle. */
|
||||
int sftp_close(SFTP_FILE *file){
|
||||
int err = SSH_NO_ERROR;
|
||||
if(file->name)
|
||||
free(file->name);
|
||||
|
||||
SAFE_FREE(file->name);
|
||||
if (file->handle){
|
||||
err = sftp_handle_close(file->sftp,file->handle);
|
||||
free(file->handle);
|
||||
string_free(file->handle);
|
||||
}
|
||||
/* FIXME: check server response and implement errno */
|
||||
free(file);
|
||||
SAFE_FREE(file);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int sftp_dir_close(SFTP_DIR *dir) {
|
||||
return sftp_closedir(dir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user