projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc9ce08
)
routeros plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:13:59 +0000
(18:13 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:13:59 +0000
(18:13 +0200)
src/routeros.c
patch
|
blob
|
history
diff --git
a/src/routeros.c
b/src/routeros.c
index
667c2fa
..
7ee3024
100644
(file)
--- a/
src/routeros.c
+++ b/
src/routeros.c
@@
-328,10
+328,9
@@
static int cr_config_router (oconfig_item_t *ci) /* {{{ */
int status;
int i;
- router_data =
malloc (
sizeof (*router_data));
+ router_data =
calloc (1,
sizeof (*router_data));
if (router_data == NULL)
return (-1);
- memset (router_data, 0, sizeof (*router_data));
router_data->connection = NULL;
router_data->node = NULL;
router_data->service = NULL;