projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f35b2b3
)
postgresql plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:09:08 +0000
(18:09 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:09:08 +0000
(18:09 +0200)
src/postgresql.c
patch
|
blob
|
history
diff --git
a/src/postgresql.c
b/src/postgresql.c
index
d532906
..
6cf5631
100644
(file)
--- 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;