From 8634b279696785a02605a8b38acf65c4d79e69f3 Mon Sep 17 00:00:00 2001 From: angt Date: Sun, 31 Jan 2016 08:27:51 +0100 Subject: [PATCH] Use calloc --- mud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mud.c b/mud.c index c1ca9cc..e7e9949 100644 --- a/mud.c +++ b/mud.c @@ -119,7 +119,7 @@ void mud_new_addr (struct mud *mud, struct sockaddr_storage *addr, socklen_t add static void mud_new_sock (struct mud *mud, int fd, int family) { - struct sock *sock = malloc(sizeof(struct sock)); + struct sock *sock = calloc(1, sizeof(struct sock)); if (!sock) return;