tree data BUGFIX uniinitialized variable
@@ -4367,14 +4367,13 @@ API LY_ERR
lyd_find_xpath(const struct lyd_node *ctx_node, const char *xpath, struct ly_set **set)
{
LY_ERR ret = LY_SUCCESS;
- struct lyxp_set xp_set;
+ struct lyxp_set xp_set = {0};
struct lyxp_expr *exp = NULL;
uint32_t i;
LY_CHECK_ARG_RET(NULL, ctx_node, xpath, set, LY_EINVAL);
*set = NULL;
- memset(&xp_set, 0, sizeof xp_set);
/* compile expression */
ret = lyxp_expr_parse((struct ly_ctx *)LYD_CTX(ctx_node), xpath, 0, 1, &exp);
@@ -4417,7 +4416,7 @@ API LY_ERR
lyd_eval_xpath(const struct lyd_node *ctx_node, const char *xpath, ly_bool *result)
{
LY_ERR ret = LY_SUCCESS;
- struct lyxp_set xp_set;
+ struct lyxp_set xp_set = {0};
struct lyxp_expr *exp = NULL;
LY_CHECK_ARG_RET(NULL, ctx_node, xpath, result, LY_EINVAL);
