schema compile UPDATE error check
diff --git a/src/schema_compile_node.c b/src/schema_compile_node.c
index ee98e6c..bdbb709 100644
--- a/src/schema_compile_node.c
+++ b/src/schema_compile_node.c
@@ -3542,6 +3542,7 @@
     } else {
         /* we need the implicit case first, so create a fake parsed (shorthand) case */
         cs_p = calloc(1, sizeof *cs_p);
+        LY_CHECK_ERR_RET(!cs_p, LOGMEM(ctx->ctx), LY_EMEM);
         cs_p->nodetype = LYS_CASE;
         DUP_STRING_GOTO(ctx->ctx, child_p->name, cs_p->name, ret, revert_sh_case);
         cs_p->child = child_p;