mem leaks

This commit is contained in:
Olof hagsand 2017-12-31 12:05:21 +01:00
parent d8269eee53
commit 79767045ad
3 changed files with 23 additions and 12 deletions

View file

@ -825,6 +825,7 @@ main(int argc, char **argv)
unlink(pidfile); unlink(pidfile);
if (sockfamily==AF_UNIX && lstat(sock, &st) == 0) if (sockfamily==AF_UNIX && lstat(sock, &st) == 0)
unlink(sock); unlink(sock);
backend_terminate(h);
exit(0); /* OK */ exit(0); /* OK */
} }
else else

View file

@ -271,6 +271,8 @@ netconf_terminate(clicon_handle h)
clicon_rpc_close_session(h); clicon_rpc_close_session(h);
if ((yspec = clicon_dbspec_yang(h)) != NULL) if ((yspec = clicon_dbspec_yang(h)) != NULL)
yspec_free(yspec); yspec_free(yspec);
if ((yspec = clicon_netconf_yang(h)) != NULL)
yspec_free(yspec);
event_exit(); event_exit();
clicon_handle_exit(h); clicon_handle_exit(h);
return 0; return 0;
@ -389,7 +391,6 @@ main(int argc,
if (netconf_plugin_load(h) < 0) if (netconf_plugin_load(h) < 0)
goto done; goto done;
/* Call start function is all plugins before we go interactive */ /* Call start function is all plugins before we go interactive */
tmp = *(argv-1); tmp = *(argv-1);
*(argv-1) = argv0; *(argv-1) = argv0;

View file

@ -126,14 +126,7 @@ xml_cmp(const void* arg1,
char *b2; char *b2;
char *keyname; char *keyname;
if (x1 == NULL){ assert(x1&&x2);
if (x2 == NULL)
return 0;
else
return -1;
}
else if (x2 == NULL)
return 1;
y1 = xml_spec(x1); y1 = xml_spec(x1);
y2 = xml_spec(x2); y2 = xml_spec(x2);
if (y1==NULL || y2==NULL) if (y1==NULL || y2==NULL)
@ -345,11 +338,26 @@ xml_search(cxobj *x0,
0, xml_child_nr(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 static int
xml_insert_pos(cxobj *x0, xml_insert_pos(cxobj *x0,
cxobj *x, char *name,
int low, int yangi,
int upper) enum rfc_6020 keyword,
int keynr,
char **keyvec,
char **keyval,
int low,
int upper)
{ {
int mid; int mid;
cxobj *xc; cxobj *xc;
@ -401,6 +409,7 @@ xml_sort_insert(cxobj *x0,
#endif #endif
return x; return x;
} }
#endif /* notyet */
/*! Find matching xml child given name and optional key values /*! Find matching xml child given name and optional key values
* container: x0, y->keyword, name * container: x0, y->keyword, name