From: Ruben Kerkhof Date: Mon, 28 Mar 2016 17:40:12 +0000 (+0200) Subject: apache: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~50 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d13a04dc3645a21acecc14a4174837766ecb6a2b;p=collectd.git apache: malloc + memset -> calloc --- diff --git a/src/apache.c b/src/apache.c index 38035caa..baa6081a 100644 --- a/src/apache.c +++ b/src/apache.c @@ -175,13 +175,12 @@ static int config_add (oconfig_item_t *ci) int i; int status; - st = malloc (sizeof (*st)); + st = calloc (1, sizeof (*st)); if (st == NULL) { - ERROR ("apache plugin: malloc failed."); + ERROR ("apache plugin: calloc failed."); return (-1); } - memset (st, 0, sizeof (*st)); st->timeout = -1;