X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=f9cf79eca47e9d2a619adc1911223e1f72d58f6d;hb=10e6e69a60f1722bb0a8a3b25bd5812471f33cfc;hp=288949a802113ed0a8d3b049ae02a65bc1dd3344;hpb=99d7118d9ec6fd9b2907cef30bfa91c72b3a5826;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 288949a8..f9cf79ec 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 */ @@ -1311,7 +1311,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 +1354,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 +1400,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 +1416,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);