author | Florian Forster <octo@collectd.org> | |
Fri, 19 May 2017 06:04:44 +0000 (08:04 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 19 May 2017 06:04:44 +0000 (08:04 +0200) |
1 | 2 | |||
---|---|---|---|---|
src/curl_json.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/curl_json.c
index b9394c273b213d2f27f35ffbfb630ca37dbf9e30,181f18bbbf29f0310ace456b99c4b2920b689673..8037742adb939214789d172da67e6981ef5372ab
--- 1/src/curl_json.c
--- 2/src/curl_json.c
+++ b/src/curl_json.c
static int cj_cb_end(void *ctx) {
cj_t *db = (cj_t *)ctx;
- db->state[db->depth].tree = NULL;
+ memset(&db->state[db->depth], 0, sizeof(db->state[db->depth]));
db->depth--;
cj_advance_array(ctx);
- return (CJ_CB_CONTINUE);
+ return CJ_CB_CONTINUE;
}
static int cj_cb_start_map(void *ctx) {
key = calloc(1, sizeof(*key));
if (key == NULL) {
ERROR("curl_json plugin: calloc failed.");
- return (-1);
+ return -1;
}
- key->magic = CJ_KEY_MAGIC;
if (strcasecmp("Key", ci->key) == 0) {
status = cf_util_get_string(ci, &key->path);