diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-17 02:59:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-17 02:59:54 +0000 |
commit | 5bc4f4fb5b383ca32b382b6c0d09602346064414 (patch) | |
tree | c741e5844c2815679107d648a15841653b9b01a5 /src/xpath.c | |
parent | Adding upstream version 3.1.0+dfsg. (diff) | |
download | libyang3-upstream.tar.xz libyang3-upstream.zip |
Adding upstream version 3.4.2+dfsg.upstream/3.4.2+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/xpath.c')
-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; } |