diff --git a/src/curl_json.c b/src/curl_json.c
index 937a237e06f7c5cba61eb6d0fc713919dc4c1ab9..510d9b621d0b9a32b235337856f455c82eef2b3e 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
#include "utils_avltree.h"
#include "utils_complain.h"
#include "utils_avltree.h"
#include "utils_complain.h"
-#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <sys/types.h>
#include <sys/un.h>
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_key_free (key);
return (-1);
}
return (-1);
}
db->tree = cj_avl_create();
tree = db->tree;
db->tree = cj_avl_create();
tree = db->tree;
- name = key->path;
ptr = key->path;
if (*ptr == '/')
++ptr;
ptr = key->path;
if (*ptr == '/')
++ptr;
if (*ptr == '/')
{
c_avl_tree_t *value;
if (*ptr == '/')
{
c_avl_tree_t *value;
- int len;
+ size_t len;
len = ptr-name;
if (len == 0)
len = ptr-name;
if (len == 0)
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else if (db->interval > 0)
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else if (db->interval > 0)
- curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
- CDTIME_T_TO_MS(db->timeout));
+ curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) CDTIME_T_TO_MS(db->timeout));
else
else
- curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
- CDTIME_T_TO_MS(plugin_get_interval()));
+ curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) CDTIME_T_TO_MS(plugin_get_interval()));
#endif
return (0);
#endif
return (0);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_free (db);
return (-1);
}
if (status != 0)
return (-1);
}
if (status != 0)