summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libssh/server.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libssh/server.c b/libssh/server.c
index e470c7c..47c509f 100644
--- a/libssh/server.c
+++ b/libssh/server.c
@@ -112,14 +112,17 @@ static socket_t bind_socket(SSH_BIND *ssh_bind, const char *hostname,
return s;
}
-SSH_BIND *ssh_bind_new(void){
- SSH_BIND *ptr = malloc(sizeof(SSH_BIND));
- if (ptr == NULL) {
- return NULL;
- }
- memset(ptr,0,sizeof(*ptr));
- ptr->bindfd=-1;
- return ptr;
+SSH_BIND *ssh_bind_new(void) {
+ SSH_BIND *ptr;
+
+ ptr = malloc(sizeof(SSH_BIND));
+ if (ptr == NULL) {
+ return NULL;
+ }
+ ZERO_STRUCTP(ptr);
+ ptr->bindfd = -1;
+
+ return ptr;
}
void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options){