json parser BUGFIX memory leak
diff --git a/src/parser_json.c b/src/parser_json.c
index ad531e0..cc59ff4 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -1338,6 +1338,7 @@
         LOGVAL(ctx, LY_VLOG_LINE, &line, LYVE_SYNTAX_JSON, "Expected top-level JSON object, but %s found.",
                 lyjson_token2str(*status));
         *lydctx_p = NULL;
+        lyd_json_ctx_free((struct lyd_ctx *)lydctx);
         return LY_EVALID;
     }
 }