memerror in uid-get. reinsert save config yang spec (removed for wrong reasons previously causing memleaks)

This commit is contained in:
Olof hagsand 2019-12-01 16:48:45 +01:00
parent 69b27f3280
commit c4954f5c43
9 changed files with 83 additions and 15 deletions

View file

@ -331,6 +331,8 @@ netconf_terminate(clicon_handle h)
clicon_rpc_close_session(h);
if ((yspec = clicon_dbspec_yang(h)) != NULL)
yspec_free(yspec);
if ((yspec = clicon_config_yang(h)) != NULL)
yspec_free(yspec);
if ((nsctx = clicon_nsctx_global_get(h)) != NULL)
cvec_free(nsctx);
if ((x = clicon_conf_xml(h)) != NULL)
@ -441,12 +443,15 @@ main(int argc,
clicon_log_init(__PROGRAM__, debug?LOG_DEBUG:LOG_INFO, logdst);
clicon_debug_init(debug, NULL);
/* Create configure yang-spec */
/* Create configure yang-spec (note different from dbspec holding application specs) */
if ((yspecfg = yspec_new()) == NULL)
goto done;
/* Find and read configfile */
if (clicon_options_main(h, yspecfg) < 0)
return -1;
if (clicon_config_yang_set(h, yspecfg) < 0)
goto done;
/* Now rest of options */
optind = 1;
opterr = 0;