X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=28d28b68e5fa56fd1584c24f5c2ead252df5dc03;hb=5b1caeeadcecd798ee4b386b15c17cb7591a8bfe;hp=288949a802113ed0a8d3b049ae02a65bc1dd3344;hpb=9706a2064c099666f24ba2fa8576629fc97310cd;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 288949a8..28d28b68 100644 --- a/src/bind.c +++ b/src/bind.c @@ -266,7 +266,7 @@ static void submit (time_t ts, const char *plugin_instance, /* {{{ */ if (type_instance) { sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance)); - replace_special (vl.plugin_instance, sizeof (vl.plugin_instance)); + replace_special (vl.type_instance, sizeof (vl.type_instance)); } plugin_dispatch_values(&vl); } /* }}} void submit */ @@ -726,8 +726,6 @@ static int bind_xml_stats_search_zones (int version, xmlDoc *doc, /* {{{ */ for (i = 0; i < zone_nodes->nodesetval->nodeNr; i++) { - xmlNode *node; - node = zone_nodes->nodesetval->nodeTab[i]; assert (node != NULL); @@ -1311,7 +1309,7 @@ static int bind_config_add_view (oconfig_item_t *ci) /* {{{ */ if (tmp->name == NULL) { ERROR ("bind plugin: strdup failed."); - free (tmp); + sfree (views); return (-1); } @@ -1354,6 +1352,7 @@ static int bind_config (oconfig_item_t *ci) /* {{{ */ return (-1); } + sfree (url); url = strdup (child->values[0].value.string); } else if (strcasecmp ("OpCodes", child->key) == 0) bind_config_set_bool ("OpCodes", &global_opcodes, child); @@ -1399,6 +1398,7 @@ static int bind_init (void) /* {{{ */ curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, bind_curl_error); curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL); curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (curl, CURLOPT_MAXREDIRS, 50L); return (0); } /* }}} int bind_init */ @@ -1414,7 +1414,7 @@ static int bind_read (void) /* {{{ */ } bind_buffer_fill = 0; - if (curl_easy_perform (curl) != 0) + if (curl_easy_perform (curl) != CURLE_OK) { ERROR ("bind plugin: curl_easy_perform failed: %s", bind_curl_error);