schema free MAINTENANCE safety check

Required by coverity.
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 7597445..4026c7f 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -810,6 +810,7 @@
             /* unlinking the last node */
             if (node->parent) {
                 iter = (struct lysc_node *)lysc_node_children(node->parent, node->flags & LYS_CONFIG_MASK);
+                LY_CHECK_ERR_RET(!iter, LOGINT(ctx), );
             } else {
                 iter = node->module->compiled->data;
             }