Skip to content

Commit 575b951

Browse files
committed
xpath CHANGE local_mod is a mandatory argument
1 parent ada77b7 commit 575b951

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/xpath.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8438,16 +8438,18 @@ int
84388438
lyxp_eval(const char *expr, const struct lyd_node *cur_node, enum lyxp_node_type cur_node_type,
84398439
const struct lys_module *local_mod, struct lyxp_set *set, int options)
84408440
{
8441-
struct ly_ctx *ctx = local_mod ? local_mod->ctx : NULL;
8441+
struct ly_ctx *ctx;
84428442
struct lyxp_expr *exp;
84438443
uint16_t exp_idx = 0;
84448444
int rc = -1;
84458445

8446-
if (!expr || !set) {
8446+
if (!expr || !local_mod || !set) {
84478447
LOGARG;
84488448
return EXIT_FAILURE;
84498449
}
84508450

8451+
ctx = local_mod->ctx;
8452+
84518453
exp = lyxp_parse_expr(ctx, expr);
84528454
if (!exp) {
84538455
rc = -1;

0 commit comments

Comments
 (0)