diff options
Diffstat (limited to '')
-rw-r--r-- | src/xpath.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xpath.c b/src/xpath.c index 8e9bf02..2251eab 100644 --- a/src/xpath.c +++ b/src/xpath.c @@ -330,7 +330,7 @@ print_set_debug(struct lyxp_set *set) (lyd_child(item->node)->schema->nodetype == LYS_LEAF)) { LOGDBG(LY_LDGXPATH, "\t%d (pos %u): ELEM %s (1st child val: %s)", i + 1, item->pos, item->node->schema->name, lyd_get_value(lyd_child(item->node))); - } else if ((!item->node->schema && !lyd_child(item->node)) || (item->node->schema->nodetype == LYS_LEAFLIST)) { + } else if (lyd_get_value(item->node)) { LOGDBG(LY_LDGXPATH, "\t%d (pos %u): ELEM %s (val: %s)", i + 1, item->pos, LYD_NAME(item->node), lyd_get_value(item->node)); } else { @@ -4042,7 +4042,7 @@ xpath_deref(struct lyxp_set **args, uint32_t UNUSED(arg_count), struct lyxp_set if (!r) { /* get the target node */ target = p[LY_ARRAY_COUNT(p) - 1].node; - ly_path_free(set->ctx, p); + ly_path_free(p); LY_CHECK_RET(lyxp_set_scnode_insert_node(set, target, LYXP_NODE_ELEM, LYXP_AXIS_SELF, NULL)); } /* else the target was found before but is disabled so it was removed */ @@ -8272,7 +8272,9 @@ cleanup: options &= ~LYXP_SKIP_EXPR; } lydict_remove(set->ctx, ncname_dict); - ly_path_predicates_free(set->ctx, predicates); + if (predicates) { + ly_path_predicates_free(scnode->module->ctx, predicates); + } return rc; } |