Skip to content

Commit 65d0f6e

Browse files
committed
libyang BUGFIX avoid uninitialized vars
1 parent d42a185 commit 65d0f6e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/ly_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static LY_ERR
316316
ly_ctx_shared_data_create(const struct ly_ctx *ctx, struct ly_ctx_shared_data **shared_data)
317317
{
318318
LY_ERR rc = LY_SUCCESS;
319-
struct ly_ctx_shared_data *shrd_data;
319+
struct ly_ctx_shared_data *shrd_data = NULL;
320320

321321
if (shared_data) {
322322
*shared_data = NULL;

src/parser_lyb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ lyd_parse_lyb(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, str
15711571

15721572
if (!(ctx->opts & LY_CTX_LYB_HASHES)) {
15731573
/* generate LYB hashes */
1574-
LY_CHECK_GOTO(rc = ly_ctx_set_options((struct ly_ctx *)ctx, LY_CTX_LYB_HASHES), cleanup);
1574+
LY_CHECK_RET(ly_ctx_set_options((struct ly_ctx *)ctx, LY_CTX_LYB_HASHES));
15751575
}
15761576

15771577
if (subtree_sibling) {

src/tree_schema.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ lys_parse_submodule(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, s
15451545
struct lysp_submodule *submod = NULL, *latest_sp;
15461546
struct lysp_yang_ctx *yangctx = NULL;
15471547
struct lysp_yin_ctx *yinctx = NULL;
1548-
struct lysp_ctx *pctx;
1548+
struct lysp_ctx *pctx = NULL;
15491549

15501550
LY_CHECK_ARG_RET(ctx, ctx, in, LY_EINVAL);
15511551

src/validation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ LIBYANG_API_DEF LY_ERR
21512151
lyd_validate_ext(struct lyd_node **ext_tree, const struct lysc_ext_instance *ext, uint32_t val_opts,
21522152
const struct lyd_node *dep_tree, struct lyd_node **diff)
21532153
{
2154-
LY_ERR rc;
2154+
LY_ERR rc = LY_SUCCESS;
21552155
struct lyd_node *next, *iter;
21562156
struct ly_set dep_set = {0};
21572157

0 commit comments

Comments
 (0)