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);
if (sockfamily==AF_UNIX && lstat(sock, &st) == 0)
unlink(sock);
backend_terminate(h);
exit(0); /* OK */
}
else

View file

@ -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;

View file

@ -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