Skip to content

Commit

Permalink
lib: yang: restore old API use now that it's fixed
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
choppsv1 committed Oct 3, 2023
1 parent 0e60135 commit 94dc74c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/yang.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 94dc74c

Please sign in to comment.