mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 18:28:10 +09:00
Improve ssh_bind_new().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@648 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -113,12 +113,15 @@ static socket_t bind_socket(SSH_BIND *ssh_bind, const char *hostname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SSH_BIND *ssh_bind_new(void) {
|
SSH_BIND *ssh_bind_new(void) {
|
||||||
SSH_BIND *ptr = malloc(sizeof(SSH_BIND));
|
SSH_BIND *ptr;
|
||||||
|
|
||||||
|
ptr = malloc(sizeof(SSH_BIND));
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(ptr,0,sizeof(*ptr));
|
ZERO_STRUCTP(ptr);
|
||||||
ptr->bindfd = -1;
|
ptr->bindfd = -1;
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user