parser json BUGFIX check error return
diff --git a/src/parser_json.c b/src/parser_json.c
index 06be6fc..4babe34 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -1424,6 +1424,9 @@
         } else if (snode->nodetype == LYS_LEAFLIST) {
             ((struct lyd_node_opaq *)*node)->hints |= LYD_NODEHINT_LEAFLIST;
         }
+    } else {
+        /* error */
+        return ret;
     }
 
     return LY_SUCCESS;