From 5ee6283526f8b96e7d2df10d6992c10a4e5f1976 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 7 Sep 2020 15:09:19 +0200 Subject: [PATCH] Fixed: [xmldb_get0 returns invalid candidate on startup transaction callbacks #126](https://github.com/clicon/clixon/issues/126). Always clear candidate-db before db initialization. --- CHANGELOG.md | 1 + apps/backend/backend_main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be5a47a..66abd3db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ Developers may need to change their code ### Corrected Bugs +* Fixed: [xmldb_get0 returns invalid candidate on startup transaction callbacks #126](https://github.com/clicon/clixon/issues/126). Always clear candidate-db before db initialization. * Fixed: YANG `uses` statements in sub-modules did not search for `grouping` statements in other submodules of the module it belongs to. * Fixed: [CLI crash if error-info is empty #134](https://github.com/clicon/clixon/issues/134) * Fixed: [copy-config's RPC cxobj parameter does not contain namespace #131](https://github.com/clicon/clixon/issues/131) diff --git a/apps/backend/backend_main.c b/apps/backend/backend_main.c index 2dd7ff2a..cd7d2939 100644 --- a/apps/backend/backend_main.c +++ b/apps/backend/backend_main.c @@ -810,6 +810,7 @@ main(int argc, if (xmldb_exists(h, "running") != 1) if (xmldb_create(h, "running") < 0) return -1; + xmldb_delete(h, "candidate"); /* If startup fails, lib functions report invalidation info in a cbuf */ if ((cbret = cbuf_new()) == NULL){ clicon_err(OE_XML, errno, "cbuf_new");