From 19e886d6b1ed59bed6b8f6ba2eb5dd9e70395809 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Wed, 6 Mar 2019 11:38:33 +0100 Subject: [PATCH] bind: Use calloc instead of malloc Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider --- src/bind.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bind.c b/src/bind.c index 4e28f774..6d3f325d 100644 --- a/src/bind.c +++ b/src/bind.c @@ -132,11 +132,10 @@ static socket_t bind_socket(ssh_bind sshbind, const char *hostname, ssh_bind ssh_bind_new(void) { ssh_bind ptr; - ptr = malloc(sizeof(struct ssh_bind_struct)); + ptr = calloc(1, sizeof(struct ssh_bind_struct)); if (ptr == NULL) { return NULL; } - ZERO_STRUCTP(ptr); ptr->bindfd = SSH_INVALID_SOCKET; ptr->bindport= 22; ptr->common.log_verbosity = 0;