yin parser BUGFIX memory leak
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 36e15e3..e3844c1 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -1650,7 +1650,8 @@
                 if (subelem->flags & YIN_SUBELEM_VER2) {
                     if (ctx->mod_version < 2) {
                         LOGVAL_PARSER((struct lys_parser_ctx *)ctx, LYVCODE_INSUBELEM2, ly_stmt2str(kw), ly_stmt2str(current_element));
-                        return LY_EVALID;
+                        ret = LY_EVALID;
+                        goto cleanup;
                     }
                 }
                 subelem->flags |= YIN_SUBELEM_PARSED;