validation BUGFIX avoid using invalid set
Refs sysrepo/sysrepo#2518
@@ -217,12 +217,14 @@ lyd_validate_unres_when(struct lyd_node **tree, const struct lys_module *mod, st
}
/* remove from node types set, if present */
+ if (node_types) {
LYD_TREE_DFS_BEGIN(node, elem) {
if (ly_set_contains(node_types, elem, &idx)) {
LY_CHECK_GOTO(ret = ly_set_rm_index(node_types, idx, NULL), error);
}
LYD_TREE_DFS_END(node, elem);
}
+ }
/* free */
lyd_free_tree(node);
