mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
sftp: Reformat sftp_ext_free()
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
9c5a1967c3
commit
61ad276a87
29
src/sftp.c
29
src/sftp.c
@@ -79,23 +79,24 @@ static sftp_ext sftp_ext_new(void) {
|
||||
return ext;
|
||||
}
|
||||
|
||||
static void sftp_ext_free(sftp_ext ext) {
|
||||
unsigned int i;
|
||||
static void sftp_ext_free(sftp_ext ext)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (ext == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ext->count) {
|
||||
for (i = 0; i < ext->count; i++) {
|
||||
SAFE_FREE(ext->name[i]);
|
||||
SAFE_FREE(ext->data[i]);
|
||||
if (ext == NULL) {
|
||||
return;
|
||||
}
|
||||
SAFE_FREE(ext->name);
|
||||
SAFE_FREE(ext->data);
|
||||
}
|
||||
|
||||
SAFE_FREE(ext);
|
||||
if (ext->count) {
|
||||
for (i = 0; i < ext->count; i++) {
|
||||
SAFE_FREE(ext->name[i]);
|
||||
SAFE_FREE(ext->data[i]);
|
||||
}
|
||||
SAFE_FREE(ext->name);
|
||||
SAFE_FREE(ext->data);
|
||||
}
|
||||
|
||||
SAFE_FREE(ext);
|
||||
}
|
||||
|
||||
sftp_session sftp_new(ssh_session session)
|
||||
|
||||
Reference in New Issue
Block a user