projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91103db
)
dbi plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:49:04 +0000
(15:49 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:49:04 +0000
(15:49 +0200)
src/dbi.c
patch
|
blob
|
history
diff --git
a/src/dbi.c
b/src/dbi.c
index
dab47d6
..
7dec51a
100644
(file)
--- a/
src/dbi.c
+++ b/
src/dbi.c
@@
-294,13
+294,12
@@
static int cdbi_config_add_database (oconfig_item_t *ci) /* {{{ */
return (-1);
}
- db =
malloc (
sizeof (*db));
+ db =
calloc (1,
sizeof (*db));
if (db == NULL)
{
- ERROR ("dbi plugin:
m
alloc failed.");
+ ERROR ("dbi plugin:
c
alloc failed.");
return (-1);
}
- memset (db, 0, sizeof (*db));
status = cf_util_get_string (ci, &db->name);
if (status != 0)