mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
Improve sftp_attributes_free().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@597 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -1238,21 +1238,20 @@ int sftp_dir_eof(SFTP_DIR *dir) {
|
|||||||
|
|
||||||
/* Free a SFTP_ATTRIBUTE handle */
|
/* Free a SFTP_ATTRIBUTE handle */
|
||||||
void sftp_attributes_free(SFTP_ATTRIBUTES *file){
|
void sftp_attributes_free(SFTP_ATTRIBUTES *file){
|
||||||
if(file->name)
|
if (file == NULL) {
|
||||||
free(file->name);
|
return;
|
||||||
if(file->longname)
|
}
|
||||||
free(file->longname);
|
|
||||||
if(file->acl)
|
string_free(file->acl);
|
||||||
free(file->acl);
|
string_free(file->extended_data);
|
||||||
if(file->extended_data)
|
string_free(file->extended_type);
|
||||||
free(file->extended_data);
|
|
||||||
if(file->extended_type)
|
SAFE_FREE(file->name);
|
||||||
free(file->extended_type);
|
SAFE_FREE(file->longname);
|
||||||
if(file->group)
|
SAFE_FREE(file->group);
|
||||||
free(file->group);
|
SAFE_FREE(file->owner);
|
||||||
if(file->owner)
|
|
||||||
free(file->owner);
|
SAFE_FREE(file);
|
||||||
free(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sftp_handle_close(SFTP_SESSION *sftp, STRING *handle){
|
static int sftp_handle_close(SFTP_SESSION *sftp, STRING *handle){
|
||||||
|
|||||||
Reference in New Issue
Block a user