projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sfree: don't check for NULL before calling free
[collectd.git]
/
src
/
bind.c
diff --git
a/src/bind.c
b/src/bind.c
index
dd49cb2
..
7d26208
100644
(file)
--- a/
src/bind.c
+++ b/
src/bind.c
@@
-54,7
+54,7
@@
# define BIND_DEFAULT_URL "http://localhost:8053/"
#endif
# define BIND_DEFAULT_URL "http://localhost:8053/"
#endif
-/*
+/*
* Some types used for the callback functions. `translation_table_ptr_t' and
* `list_info_ptr_t' are passed to the callbacks in the `void *user_data'
* pointer.
* Some types used for the callback functions. `translation_table_ptr_t' and
* `list_info_ptr_t' are passed to the callbacks in the `void *user_data'
* pointer.
@@
-277,14
+277,14
@@
static size_t bind_curl_callback (void *buf, size_t size, /* {{{ */
{
size_t len = size * nmemb;
{
size_t len = size * nmemb;
- if (len
<
= 0)
+ if (len
=
= 0)
return (len);
if ((bind_buffer_fill + len) >= bind_buffer_size)
{
char *temp;
return (len);
if ((bind_buffer_fill + len) >= bind_buffer_size)
{
char *temp;
- temp = realloc(bind_buffer, bind_buffer_fill + len + 1);
+ temp = realloc
(bind_buffer, bind_buffer_fill + len + 1);
if (temp == NULL)
{
ERROR ("bind plugin: realloc failed.");
if (temp == NULL)
{
ERROR ("bind plugin: realloc failed.");
@@
-474,7
+474,7
@@
static int bind_xml_read_timestamp (const char *xpath_expression, /* {{{ */
return (0);
} /* }}} int bind_xml_read_timestamp */
return (0);
} /* }}} int bind_xml_read_timestamp */
-/*
+/*
* bind_parse_generic_name_value
*
* Reads statistics in the form:
* bind_parse_generic_name_value
*
* Reads statistics in the form:
@@
-559,7
+559,7
@@
static int bind_parse_generic_name_value (const char *xpath_expression, /* {{{ *
return (0);
} /* }}} int bind_parse_generic_name_value */
return (0);
} /* }}} int bind_parse_generic_name_value */
-/*
+/*
* bind_parse_generic_value_list
*
* Reads statistics in the form:
* bind_parse_generic_value_list
*
* Reads statistics in the form:
@@
-774,7
+774,7
@@
static int bind_xml_stats_handle_zone (int version, xmlDoc *doc, /* {{{ */
{ /* Parse the <counters> tag {{{ */
char plugin_instance[DATA_MAX_NAME_LEN];
translation_table_ptr_t table_ptr =
{ /* Parse the <counters> tag {{{ */
char plugin_instance[DATA_MAX_NAME_LEN];
translation_table_ptr_t table_ptr =
- {
+ {
nsstats_translation_table,
nsstats_translation_table_length,
plugin_instance
nsstats_translation_table,
nsstats_translation_table_length,
plugin_instance
@@
-836,8
+836,6
@@
static int bind_xml_stats_search_zones (int version, xmlDoc *doc, /* {{{ */
for (i = 0; i < zone_nodes->nodesetval->nodeNr; i++)
{
for (i = 0; i < zone_nodes->nodesetval->nodeNr; i++)
{
- xmlNode *node;
-
node = zone_nodes->nodesetval->nodeTab[i];
assert (node != NULL);
node = zone_nodes->nodesetval->nodeTab[i];
assert (node != NULL);
@@
-957,7
+955,7
@@
static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */
{
char plugin_instance[DATA_MAX_NAME_LEN];
translation_table_ptr_t table_ptr =
{
char plugin_instance[DATA_MAX_NAME_LEN];
translation_table_ptr_t table_ptr =
- {
+ {
resstats_translation_table,
resstats_translation_table_length,
plugin_instance
resstats_translation_table,
resstats_translation_table_length,
plugin_instance
@@
-1615,7
+1613,7
@@
static int bind_config_add_view_zone (cb_view_t *view, /* {{{ */
return (-1);
}
return (-1);
}
- tmp =
(char **)
realloc (view->zones,
+ tmp = realloc (view->zones,
sizeof (char *) * (view->zones_num + 1));
if (tmp == NULL)
{
sizeof (char *) * (view->zones_num + 1));
if (tmp == NULL)
{
@@
-1646,7
+1644,7
@@
static int bind_config_add_view (oconfig_item_t *ci) /* {{{ */
return (-1);
}
return (-1);
}
- tmp =
(cb_view_t *)
realloc (views, sizeof (*views) * (views_num + 1));
+ tmp = realloc (views, sizeof (*views) * (views_num + 1));
if (tmp == NULL)
{
ERROR ("bind plugin: realloc failed.");
if (tmp == NULL)
{
ERROR ("bind plugin: realloc failed.");