projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4743f19
)
curl: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 28 Mar 2016 17:42:36 +0000
(19:42 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 28 Mar 2016 17:42:36 +0000
(19:42 +0200)
src/curl.c
patch
|
blob
|
history
diff --git
a/src/curl.c
b/src/curl.c
index
f6127a9
..
5f78207
100644
(file)
--- a/
src/curl.c
+++ b/
src/curl.c
@@
-270,13
+270,12
@@
static int cc_config_add_match (web_page_t *page, /* {{{ */
WARNING ("curl plugin: Ignoring arguments for the `Match' block.");
}
WARNING ("curl plugin: Ignoring arguments for the `Match' block.");
}
- match =
malloc (
sizeof (*match));
+ match =
calloc (1,
sizeof (*match));
if (match == NULL)
{
if (match == NULL)
{
- ERROR ("curl plugin:
m
alloc failed.");
+ ERROR ("curl plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (match, 0, sizeof (*match));
status = 0;
for (i = 0; i < ci->children_num; i++)
status = 0;
for (i = 0; i < ci->children_num; i++)
@@
-436,13
+435,12
@@
static int cc_config_add_page (oconfig_item_t *ci) /* {{{ */
return (-1);
}
return (-1);
}
- page =
malloc (
sizeof (*page));
+ page =
calloc (1,
sizeof (*page));
if (page == NULL)
{
if (page == NULL)
{
- ERROR ("curl plugin:
m
alloc failed.");
+ ERROR ("curl plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (page, 0, sizeof (*page));
page->url = NULL;
page->user = NULL;
page->pass = NULL;
page->url = NULL;
page->user = NULL;
page->pass = NULL;