]> PatchyGit - patchyircd.git/commitdiff
clean up allocClient
authorEgor <egor@patchysicp.xyz>
Wed, 18 Oct 2023 20:19:26 +0000 (23:19 +0300)
committerEgor <egor@patchysicp.xyz>
Wed, 18 Oct 2023 20:19:26 +0000 (23:19 +0300)
net.c

diff --git a/net.c b/net.c
index 90d4c3c..6bb682d 100644 (file)
--- a/net.c
+++ b/net.c
@@ -6,11 +6,10 @@
 #include <poll.h>
 #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)