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:
Anderson Toshiyuki Sasaki
2019-01-26 13:50:38 +01:00
committed by Andreas Schneider
parent 9c5a1967c3
commit 61ad276a87

View File

@@ -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)