From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:02:18 +0000 (+0200) Subject: openldap plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~25 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b25a043cbfb31a7e232eb4f2507583273a1407a0;p=collectd.git openldap plugin: malloc + memset -> calloc --- diff --git a/src/openldap.c b/src/openldap.c index 0a86d521..055f2d16 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -553,13 +553,12 @@ static int cldap_config_add (oconfig_item_t *ci) /* {{{ */ int i; int status; - st = malloc (sizeof (*st)); + st = calloc (1, sizeof (*st)); if (st == NULL) { - ERROR ("openldap plugin: malloc failed."); + ERROR ("openldap plugin: calloc failed."); return (-1); } - memset (st, 0, sizeof (*st)); status = cf_util_get_string (ci, &st->name); if (status != 0)