From b66183ecc28be24f668c20fb40e33513f6f028fc Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:24:23 +0200 Subject: [PATCH] teamspeak2: malloc + memset -> calloc --- src/teamspeak2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 345f57e0..263863b9 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -83,13 +83,12 @@ static int tss2_add_vserver (int vserver_port) } /* Allocate memory */ - entry = malloc (sizeof (*entry)); + entry = calloc (1, sizeof (*entry)); if (entry == NULL) { - ERROR ("teamspeak2 plugin: malloc failed."); + ERROR ("teamspeak2 plugin: calloc failed."); return (-1); } - memset (entry, 0, sizeof (vserver_list_t)); /* Save data */ entry->port = vserver_port; -- 2.30.2