projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
665099d
)
mysql plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:18:42 +0000
(17:18 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:18:42 +0000
(17:18 +0200)
src/mysql.c
patch
|
blob
|
history
diff --git
a/src/mysql.c
b/src/mysql.c
index
029796e
..
4c94732
100644
(file)
--- 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:
m
alloc failed.");
+ ERROR ("mysql plugin:
c
alloc failed.");
return (-1);
}
- memset (db, 0, sizeof (*db));
/* initialize all the pointers */
db->alias = NULL;