diff --git a/apps/backend/backend_main.c b/apps/backend/backend_main.c index ef094a39..cf4e6422 100644 --- a/apps/backend/backend_main.c +++ b/apps/backend/backend_main.c @@ -825,6 +825,7 @@ main(int argc, char **argv) unlink(pidfile); if (sockfamily==AF_UNIX && lstat(sock, &st) == 0) unlink(sock); + backend_terminate(h); exit(0); /* OK */ } else diff --git a/apps/netconf/netconf_main.c b/apps/netconf/netconf_main.c index cb97cf9b..62584917 100644 --- a/apps/netconf/netconf_main.c +++ b/apps/netconf/netconf_main.c @@ -271,6 +271,8 @@ netconf_terminate(clicon_handle h) clicon_rpc_close_session(h); if ((yspec = clicon_dbspec_yang(h)) != NULL) yspec_free(yspec); + if ((yspec = clicon_netconf_yang(h)) != NULL) + yspec_free(yspec); event_exit(); clicon_handle_exit(h); return 0; @@ -389,7 +391,6 @@ main(int argc, if (netconf_plugin_load(h) < 0) goto done; - /* Call start function is all plugins before we go interactive */ tmp = *(argv-1); *(argv-1) = argv0; diff --git a/lib/src/clixon_xml_sort.c b/lib/src/clixon_xml_sort.c index 9212ca58..e49715db 100644 --- a/lib/src/clixon_xml_sort.c +++ b/lib/src/clixon_xml_sort.c @@ -126,14 +126,7 @@ xml_cmp(const void* arg1, char *b2; char *keyname; - if (x1 == NULL){ - if (x2 == NULL) - return 0; - else - return -1; - } - else if (x2 == NULL) - return 1; + assert(x1&&x2); y1 = xml_spec(x1); y2 = xml_spec(x2); if (y1==NULL || y2==NULL) @@ -345,11 +338,26 @@ xml_search(cxobj *x0, 0, xml_child_nr(x0)); } +#ifdef notyet +/*! Position where to insert xml object into a list of children nodes + * Insert after position returned + * @param[in] x0 XML parent node. + * @param[in] x XML node (to insert) + * @param[in] low Lower bound + * @param[in] upper Upper bound (+1) + * @retval position + * XXX: Replace "x" with parameters in xml_search1 + */ static int xml_insert_pos(cxobj *x0, - cxobj *x, - int low, - int upper) + char *name, + int yangi, + enum rfc_6020 keyword, + int keynr, + char **keyvec, + char **keyval, + int low, + int upper) { int mid; cxobj *xc; @@ -401,6 +409,7 @@ xml_sort_insert(cxobj *x0, #endif return x; } +#endif /* notyet */ /*! Find matching xml child given name and optional key values * container: x0, y->keyword, name