diff --git a/lib/src/clixon_event.c b/lib/src/clixon_event.c index 7ff34547..34f2795f 100644 --- a/lib/src/clixon_event.c +++ b/lib/src/clixon_event.c @@ -255,8 +255,15 @@ clixon_event_reg_timeout(struct timeval t, void *arg, char *str) { - struct event_data *e, *e1, **e_prev; + int retval = -1; + struct event_data *e; + struct event_data *e1; + struct event_data **e_prev; + if (str == NULL || fn == NULL){ + clicon_err(OE_CFG, EINVAL, "str or fn is NULL"); + goto done; + } if ((e = (struct event_data *)malloc(sizeof(struct event_data))) == NULL){ clicon_err(OE_EVENTS, errno, "malloc"); return -1; @@ -277,7 +284,9 @@ clixon_event_reg_timeout(struct timeval t, e->e_next = e1; *e_prev = e; clicon_debug(CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str); - return 0; + retval = 0; + done: + return retval; } /*! Deregister a timeout callback as previosly registered by clixon_event_reg_timeout() diff --git a/lib/src/clixon_xpath_yang.c b/lib/src/clixon_xpath_yang.c index 0802883e..dde39e3f 100644 --- a/lib/src/clixon_xpath_yang.c +++ b/lib/src/clixon_xpath_yang.c @@ -334,8 +334,10 @@ xp_yang_eval(xp_yang_ctx *xy, break; case XP_ABSPATH: /* Set context node to top node, and nodeset to that node only */ - if (yang_keyword_get(xy->xy_node) != Y_SPEC) - xy->xy_node = ys_module(xy->xy_node); + if (yang_keyword_get(xy->xy_node) != Y_SPEC){ + if (ys_real_module(xy->xy_node, &xy->xy_node) < 0) + goto done; + } break; case XP_PRED: if (xp_yang_eval_predicate(xy, xptree, xyr) < 0) diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index f3942917..c04b8172 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -1043,7 +1043,7 @@ yang_parse_filename(clicon_handle h, if ((ymod = yang_parse_file(fp, filename, yspec)) < 0) goto done; /* YANG patch hook */ - if (h && clixon_plugin_yang_patch_all(h, ymod) < 0) + if (ymod && h && clixon_plugin_yang_patch_all(h, ymod) < 0) goto done; done: if (fp)