schema compile MAINTENANCE check return value
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 4da547d..da27d78 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -5594,7 +5594,7 @@
             }
 
             /* store the default value in unres */
-            lysc_incomplete_leaf_dflt_add(ctx, leaf, d->dflts[0], ctx->mod_def);
+            LY_CHECK_GOTO(lysc_incomplete_leaf_dflt_add(ctx, leaf, d->dflts[0], ctx->mod_def), cleanup);
             target->flags |= LYS_SET_DFLT;
             break;
         case LYS_LEAFLIST: