From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:24:23 +0000 (+0200) Subject: teamspeak2: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b66183ecc28be24f668c20fb40e33513f6f028fc;p=collectd.git teamspeak2: malloc + memset -> calloc --- 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;