projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f43b86a
)
powerdns plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:10:07 +0000
(18:10 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:10:07 +0000
(18:10 +0200)
src/powerdns.c
patch
|
blob
|
history
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
e80ca8a
..
1c41ff8
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-840,13
+840,12
@@
static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */
return (-1);
}
- item =
malloc (
sizeof (*item));
+ item =
calloc (1,
sizeof (*item));
if (item == NULL)
{
- ERROR ("powerdns plugin:
m
alloc failed.");
+ ERROR ("powerdns plugin:
c
alloc failed.");
return (-1);
}
- memset (item, '\0', sizeof (list_item_t));
item->instance = strdup (ci->values[0].value.string);
if (item->instance == NULL)