diff --git a/library/model_support.c b/library/model_support.c index 6b89a1f4..4b94a838 100644 --- a/library/model_support.c +++ b/library/model_support.c @@ -528,7 +528,6 @@ static int parse_obj(void *obj, const char *json, jsmntok_t *tok, type_meta *met tokens_processed += rc; } else { - ZITI_LOG(TRACE, "skipping unmapped field[%.*s] while parsing %s", tok->end - tok->start, json + tok->start, meta->name); tok++; int end = tok->end; while (tok->type != JSMN_UNDEFINED && tok->start <= end) { diff --git a/library/ziti_ctrl.c b/library/ziti_ctrl.c index 7c351bf5..c781b27c 100644 --- a/library/ziti_ctrl.c +++ b/library/ziti_ctrl.c @@ -230,6 +230,11 @@ static void ctrl_body_cb(um_http_req_t *req, const char *b, ssize_t len) { resp->total = cr.meta.pagination.total; resp->resp_array = realloc(resp->resp_array, (resp->total + 1) * sizeof(void *)); } + // empty result + if (resp->resp_array == NULL) { + resp->resp_array = calloc(1, sizeof(void *)); + } + void **chunk = resp_obj; while (*chunk != NULL) { resp->resp_array[resp->recd++] = *chunk++; @@ -249,7 +254,8 @@ static void ctrl_body_cb(um_http_req_t *req, const char *b, ssize_t len) { } } - free_api_resp(&cr); + free_resp_meta(&cr.meta); + FREE(cr.data); FREE(resp->body); resp->ctrl_cb(resp_obj, cr.error, resp);