diff --git a/CHANGELOG.md b/CHANGELOG.md index a9216baf..3a925b2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Developers may need to change their code ### Corrected Bugs +* Fixed: Segv in canonical xpath transform * Fixed: [Error with submodules and feature Interaction](https://github.com/clicon/clixon-controller/issues/158) * Fixed: [Expansion removes the double quote](https://github.com/clicon/clixon/issues/524) * Add escaping in expand_dbvar instead of automatic in cligen expand diff --git a/lib/src/clixon_xpath.c b/lib/src/clixon_xpath.c index 6367ac50..9078c3da 100644 --- a/lib/src/clixon_xpath.c +++ b/lib/src/clixon_xpath.c @@ -1112,7 +1112,7 @@ xpath_traverse_canonical(xpath_tree *xs, free(xs->xs_s0); xs->xs_s0 = NULL; } - if ((xs->xs_s0 = strdup(prefix1)) == NULL){ + if (prefix1 && (xs->xs_s0 = strdup(prefix1)) == NULL){ clixon_err(OE_UNIX, errno, "strdup"); goto done; }