diff --git a/CHANGELOG.md b/CHANGELOG.md index d464b3d2..f17dfb00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ ## 7.1.0 Expected: May 2024 +### Corrected Bugs + +* Fixed: [Startup and default of same object causes too-many-elements error](https://github.com/clicon/clixon/issues/503) + ## 7.0.0 8 March 2024 @@ -107,7 +111,7 @@ Developers may need to change their code * `clicon_strerror(int)` -> `clixon_err_str()` * `clicon_netconf_error(h, x, fmt)` -> clixon_err_netconf(h, OE_XML, 0, x, fmt)` * `netconf_err2cb(...)` --> `netconf_err2cb(h, ...)` - * Likewise for some other minor functions: `clicon_err_*` -> `clixon_err_*` + * Likewise for some other minor functions: `clicon_err_*` -> `clixon_err_*` * Replaced global variables with access functions. Replace variables with functions as follows: * `clicon_errno` -> `clixon_err_category()` * `clicon_suberrno` -> `clixon_err_subnr()` diff --git a/lib/src/clixon_datastore_read.c b/lib/src/clixon_datastore_read.c index 230e41f9..a15c0807 100644 --- a/lib/src/clixon_datastore_read.c +++ b/lib/src/clixon_datastore_read.c @@ -731,11 +731,13 @@ xmldb_get_cache(clixon_handle h, clicon_db_elmnt_set(h, db, &de0); /* Content is copied */ /* Add default global values (to make xpath below include defaults) */ // Alt: xmldb_populate(h, db) - if (xml_global_defaults(h, x0t, nsc, xpath, yspec, 0) < 0) - goto done; - /* Add default recursive values */ - if (xml_default_recurse(x0t, 0, 0) < 0) - goto done; + if (yb != YB_NONE) { + if (xml_global_defaults(h, x0t, nsc, xpath, yspec, 0) < 0) + goto done; + /* Add default recursive values */ + if (xml_default_recurse(x0t, 0, 0) < 0) + goto done; + } } /* x0t == NULL */ else x0t = de->de_xml;