schema tree CHANGE outer subtree dependency flag now also for leafref
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 95c99bc..7c143fb 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -2043,7 +2043,7 @@
                 goto error;
             }
 
-            dev_target->flags &= ~LYS_XPATH_DEP;
+            dev_target->flags &= ~LYS_VALID_DEP;
 
             if (d->mod == LY_DEVIATE_RPL) {
                 /* replace must is forbidden */