mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
Improve ssh_bind_free().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@653 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -252,12 +252,18 @@ SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ssh_bind_free(SSH_BIND *ssh_bind){
|
void ssh_bind_free(SSH_BIND *ssh_bind){
|
||||||
if(ssh_bind->bindfd>=0)
|
if (ssh_bind == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ssh_bind->bindfd >= 0) {
|
||||||
close(ssh_bind->bindfd);
|
close(ssh_bind->bindfd);
|
||||||
ssh_bind->bindfd=-1;
|
}
|
||||||
if(ssh_bind->options)
|
ssh_bind->bindfd = -1;
|
||||||
|
if (ssh_bind->options) {
|
||||||
ssh_options_free(ssh_bind->options);
|
ssh_options_free(ssh_bind->options);
|
||||||
free(ssh_bind);
|
}
|
||||||
|
SAFE_FREE(ssh_bind);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern char *supported_methods[];
|
extern char *supported_methods[];
|
||||||
|
|||||||
Reference in New Issue
Block a user