Skip to content

Commit 0cb7d04

Browse files
committed
src/parser_lyb.c: coverity fix - dereference after null check
1 parent b64958d commit 0cb7d04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser_lyb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ lyb_parse_schema_hash(struct lyd_lyb_ctx *lybctx, const struct lysc_node *sparen
837837
} else if (mod) {
838838
LOGVAL(lybctx->lybctx->ctx, LYVE_REFERENCE, "Failed to find matching hash for a top-level node"
839839
" from \"%s\".", mod->name);
840-
} else {
840+
} else if (sparent) {
841841
LOGVAL(lybctx->lybctx->ctx, LYVE_REFERENCE, "Failed to find matching hash for a child node"
842842
" of \"%s\".", sparent->name);
843843
}

0 commit comments

Comments
 (0)