JSON parser BUGFIX memory leak
Reported by coverity.
@@ -964,12 +964,8 @@ lydjson_parse_opaq(struct lyd_json_ctx *lydctx, const char *name, size_t name_le
LYD_JSON, val_prefs, prefix, prefix_len, module_name, module_name_len, node_p);
if (dynamic) {
free((char*)value);
- dynamic = 0;
}
- value = NULL;
- value_len = 0;
- val_prefs = NULL;
- LY_CHECK_RET(ret);
+ LY_CHECK_ERR_RET(ret, ly_free_val_prefs(lydctx->jsonctx->ctx, val_prefs), ret);
if (*status_p == LYJSON_OBJECT || *status_p == LYJSON_OBJECT_EMPTY) {
/* process children */
