mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
sftp: Reformat sftp_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit d840a05be3)
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 */
|
#endif /* WITH_SERVER */
|
||||||
|
|
||||||
void sftp_free(sftp_session sftp){
|
void sftp_free(sftp_session sftp)
|
||||||
sftp_request_queue ptr;
|
{
|
||||||
|
sftp_request_queue ptr;
|
||||||
|
|
||||||
if (sftp == NULL) {
|
if (sftp == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_channel_send_eof(sftp->channel);
|
ssh_channel_send_eof(sftp->channel);
|
||||||
ptr = sftp->queue;
|
ptr = sftp->queue;
|
||||||
while(ptr) {
|
while(ptr) {
|
||||||
sftp_request_queue old;
|
sftp_request_queue old;
|
||||||
sftp_message_free(ptr->message);
|
sftp_message_free(ptr->message);
|
||||||
old = ptr->next;
|
old = ptr->next;
|
||||||
SAFE_FREE(ptr);
|
SAFE_FREE(ptr);
|
||||||
ptr = old;
|
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);
|
sftp_ext_free(sftp->ext);
|
||||||
ZERO_STRUCTP(sftp);
|
ZERO_STRUCTP(sftp);
|
||||||
|
|
||||||
SAFE_FREE(sftp);
|
SAFE_FREE(sftp);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload){
|
int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload){
|
||||||
|
|||||||
Reference in New Issue
Block a user