projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58b2eba
)
openldap plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:02:18 +0000
(18:02 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:02:18 +0000
(18:02 +0200)
src/openldap.c
patch
|
blob
|
history
diff --git
a/src/openldap.c
b/src/openldap.c
index
0a86d52
..
055f2d1
100644
(file)
--- a/
src/openldap.c
+++ b/
src/openldap.c
@@
-553,13
+553,12
@@
static int cldap_config_add (oconfig_item_t *ci) /* {{{ */
int i;
int status;
- st =
malloc (
sizeof (*st));
+ st =
calloc (1,
sizeof (*st));
if (st == NULL)
{
- ERROR ("openldap plugin:
m
alloc failed.");
+ ERROR ("openldap plugin:
c
alloc failed.");
return (-1);
}
- memset (st, 0, sizeof (*st));
status = cf_util_get_string (ci, &st->name);
if (status != 0)