summaryrefslogtreecommitdiff
path: root/lib/yang.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-07-09 16:55:10 -0400
committerChristian Hopps <chopps@labn.net>2023-11-06 17:44:58 -0500
commit3184f63a900ff1f38a972a2e989b28f3a4306b69 (patch)
treee4881c6d498587bfd32a063aba1789ba24f98475 /lib/yang.c
parenta65cda16b28bc84b052636118823082de9600cfc (diff)
lib: yang: restore old API use now that it's fixed
This also avoids a bug in the workaround function if the set variable wasn't set to NULL the Debug version of libyang would sigsegv. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/yang.c b/lib/yang.c
index 4dd8654217..7046091baa 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -254,15 +254,8 @@ struct lysc_node *yang_find_snode(struct ly_ctx *ly_ctx, const char *xpath,
uint32_t options)
{
struct lysc_node *snode;
- struct ly_set *set;
- LY_ERR err;
- err = lys_find_xpath(ly_native_ctx, NULL, xpath, options, &set);
- if (err || !set->count)
- return NULL;
-
- snode = set->snodes[0];
- ly_set_free(set, NULL);
+ snode = (struct lysc_node *)lys_find_path(ly_ctx, NULL, xpath, 0);
return snode;
}