From aacc2e30f17fa2e47ac8d2531ac69bb748304296 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 17:18:42 +0200 Subject: [PATCH] mysql plugin: malloc + memset -> calloc --- src/mysql.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mysql.c b/src/mysql.c index 029796e6..4c94732b 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -113,13 +113,12 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ return (-1); } - db = malloc (sizeof (*db)); + db = calloc (1, sizeof (*db)); if (db == NULL) { - ERROR ("mysql plugin: malloc failed."); + ERROR ("mysql plugin: calloc failed."); return (-1); } - memset (db, 0, sizeof (*db)); /* initialize all the pointers */ db->alias = NULL; -- 2.11.0