diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index 8e47315c..5942cb2c 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -776,7 +776,7 @@ yang2cli_list(clicon_handle h, int retval = -1; char *helptext = NULL; char *s; - int list_has_callback; + int list_has_callback = 0; cprintf(cb, "%*s%s", level*3, "", yang_argument_get(ys)); if ((yd = yang_find(ys, Y_DESCRIPTION, NULL)) != NULL){ @@ -836,9 +836,9 @@ yang2cli_list(clicon_handle h, goto done; } cprintf(cb, "%*s}\n", level*3, ""); - if ((show_tree == 1) && (list_has_callback)) { - cprintf(cb, "%*s}\n", level*3, ""); - } + if ((show_tree == 1) && (list_has_callback)) { + cprintf(cb, "%*s}\n", level*3, ""); + } retval = 0; done: if (helptext) diff --git a/example/main/example_backend.c b/example/main/example_backend.c index 79f07c48..5ad4381b 100644 --- a/example/main/example_backend.c +++ b/example/main/example_backend.c @@ -399,6 +399,8 @@ example_statedata(clicon_handle h, clicon_err(OE_UNIX, errno, "open(%s)", _state_file); goto done; } + if ((xt = xml_new("config", NULL, CX_ELMNT)) == NULL) + goto done; if (clixon_xml_parse_file(fd, YB_MODULE, yspec, NULL, &xt, NULL) < 0) goto done; close(fd); @@ -417,7 +419,6 @@ example_statedata(clicon_handle h, } if (xml_copy(xt, xstate) < 0) goto done; - if (xvec){ free(xvec); xvec = 0; diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index 6427f089..ff228881 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -234,8 +234,21 @@ yang_augment_node(yang_stmt *ys, /* Find the target */ if (yang_abs_schema_nodeid(ysp, ys, schema_nodeid, -1, &ytarget) < 0) goto done; - if (ytarget == NULL) + + if (ytarget == NULL){ +#if 0 + clicon_err(OE_YANG, 0, "Augment failed in module %s: target node %s not found", + yang_argument_get(ys_module(ys)), + schema_nodeid); + goto done; +#else + clicon_log(LOG_WARNING, "Warning: Augment failed in module %s: target node %s not found", + yang_argument_get(ys_module(ys)), + schema_nodeid); goto ok; +#endif + } + /* Find when statement, if present */ if ((ywhen = yang_find(ys, Y_WHEN, NULL)) != NULL){ wxpath = yang_argument_get(ywhen);