From: Florian Forster Date: Fri, 19 May 2017 06:04:44 +0000 (+0200) Subject: Merge remote-tracking branch 'github/pr/2285' X-Git-Tag: collectd-5.8.0~168 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=c144ae4659e129a929afb67706a54604220fef43 Merge remote-tracking branch 'github/pr/2285' --- c144ae4659e129a929afb67706a54604220fef43 diff --cc src/curl_json.c index b9394c27,181f18bb..8037742a --- a/src/curl_json.c +++ b/src/curl_json.c @@@ -297,10 -293,10 +293,10 @@@ static int cj_cb_string(void *ctx, cons 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) { @@@ -502,9 -511,8 +511,8 @@@ static int cj_config_add_key(cj_t *db, 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);