From b25a043cbfb31a7e232eb4f2507583273a1407a0 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:02:18 +0200 Subject: [PATCH] openldap plugin: malloc + memset -> calloc --- src/openldap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) -- 2.30.2