From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:09:08 +0000 (+0200) Subject: postgresql plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f43b86af318bad0804323e86c004eaf3324cd047;p=collectd.git postgresql plugin: malloc + memset -> calloc --- diff --git a/src/postgresql.c b/src/postgresql.c index d532906c..6cf56318 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -1042,12 +1042,11 @@ static int config_query_param_add (udb_query_t *q, oconfig_item_t *ci) data = udb_query_get_user_data (q); if (NULL == data) { - data = malloc (sizeof (*data)); + data = calloc (1, sizeof (*data)); if (NULL == data) { log_err ("Out of memory."); return -1; } - memset (data, 0, sizeof (*data)); data->params = NULL; data->params_num = 0;