From: Ruben Kerkhof Date: Fri, 1 Apr 2016 13:50:42 +0000 (+0200) Subject: email plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~42 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e9851b740269826feafefb82350e7446c941148a;p=collectd.git email plugin: malloc + memset -> calloc --- diff --git a/src/email.c b/src/email.c index 8898c087..ea4e7850 100644 --- a/src/email.c +++ b/src/email.c @@ -537,13 +537,12 @@ static void *open_connection (void __attribute__((unused)) *arg) break; } - connection = malloc (sizeof (*connection)); + connection = calloc (1, sizeof (*connection)); if (connection == NULL) { close (remote); continue; } - memset (connection, 0, sizeof (*connection)); connection->socket = fdopen (remote, "r"); connection->next = NULL;