From 445a1b150d6233eba6b5e43255c9871aed31a857 Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 18 Oct 2023 23:19:26 +0300 Subject: [PATCH] clean up allocClient --- net.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index 90d4c3c..6bb682d 100644 --- a/net.c +++ b/net.c @@ -6,11 +6,10 @@ #include #endif -struct client_data *allocClient(){ - struct client_data *NewClient = malloc(sizeof(struct client_data)); - memset(NewClient, 0, sizeof(struct client_data)); - return NewClient; -}; +struct client_data *allocClient() +{ + return calloc(1, sizeof(struct client_data)); +} #ifdef HAS_TLS static void block(struct client_data *cl, int out) -- 2.56.0