schema compile BUGFIX memory leak
use common cleanup section instead of direct return after error
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index c7ef5b7..da5e9c0 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -3846,7 +3846,7 @@
cs->sp = node_p;
/* check the case's status (don't need to solve uses_status since case statement cannot be directly in grouping statement */
- LY_CHECK_RET(lys_compile_status(ctx, &cs->flags, ch->flags), NULL);
+ LY_CHECK_GOTO(lys_compile_status(ctx, &cs->flags, ch->flags), error);
if (node_p->when) {
LY_ARRAY_NEW_GOTO(ctx->ctx, cs->when, when, ret, error);