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);