mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
sftp: Reformat sftp_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
39
src/sftp.c
39
src/sftp.c
@@ -244,31 +244,32 @@ int sftp_server_init(sftp_session sftp){
|
||||
}
|
||||
#endif /* WITH_SERVER */
|
||||
|
||||
void sftp_free(sftp_session sftp){
|
||||
sftp_request_queue ptr;
|
||||
void sftp_free(sftp_session sftp)
|
||||
{
|
||||
sftp_request_queue ptr;
|
||||
|
||||
if (sftp == NULL) {
|
||||
return;
|
||||
}
|
||||
if (sftp == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
ssh_channel_send_eof(sftp->channel);
|
||||
ptr = sftp->queue;
|
||||
while(ptr) {
|
||||
sftp_request_queue old;
|
||||
sftp_message_free(ptr->message);
|
||||
old = ptr->next;
|
||||
SAFE_FREE(ptr);
|
||||
ptr = old;
|
||||
}
|
||||
ssh_channel_send_eof(sftp->channel);
|
||||
ptr = sftp->queue;
|
||||
while(ptr) {
|
||||
sftp_request_queue old;
|
||||
sftp_message_free(ptr->message);
|
||||
old = ptr->next;
|
||||
SAFE_FREE(ptr);
|
||||
ptr = old;
|
||||
}
|
||||
|
||||
ssh_channel_free(sftp->channel);
|
||||
ssh_channel_free(sftp->channel);
|
||||
|
||||
SAFE_FREE(sftp->handles);
|
||||
SAFE_FREE(sftp->handles);
|
||||
|
||||
sftp_ext_free(sftp->ext);
|
||||
ZERO_STRUCTP(sftp);
|
||||
sftp_ext_free(sftp->ext);
|
||||
ZERO_STRUCTP(sftp);
|
||||
|
||||
SAFE_FREE(sftp);
|
||||
SAFE_FREE(sftp);
|
||||
}
|
||||
|
||||
int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload){
|
||||
|
||||
Reference in New Issue
Block a user