From 1defd2afc74adb30eaae33cfce48d6b4aeac3d94 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 11 Nov 2019 21:47:03 +0100 Subject: [PATCH] memleak --- CHANGELOG.md | 2 -- lib/src/clixon_xml_map.c | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d7dc3ac..3b98429f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,13 +8,11 @@ * State callbacks provided by user are validated. If they are invalid an internal error is returned. * Fixed multi-namespace for augmented state which was not covered in 4.2.0. - ### API changes on existing features (you may need to change your code) * The multi-namespace augment state may rearrange the XML namespace attributes. * Main example yang changed to incorporate augmented state, new revision is 2019-11-15. ### Corrected Bugs - * Mandatory variables can no longer be deleted. * [Add missing includes](https://github.com/clicon/clixon/pulls) diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index e6217e37..a5f03729 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -2243,12 +2243,10 @@ xml_default(cxobj *xt, goto done; } else{ /* namespace does not exist in target, use source prefix */ - char *prefix1 = NULL; - if ((prefix1 = strdup(yang_find_myprefix(y))) == NULL){ + if ((prefix = yang_find_myprefix(y)) == NULL){ clicon_err(OE_UNIX, errno, "strdup"); goto done; } - if (add_namespace(xc, xt, prefix1, namespace) < 0) goto done; }