From 353f2e603878b63ee89d6a08c6fdbda5c90cf369 Mon Sep 17 00:00:00 2001 From: Olof Hagsand Date: Tue, 15 May 2018 22:24:44 +0200 Subject: [PATCH] added merge of json trees --- lib/src/clixon_json.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/clixon_json.c b/lib/src/clixon_json.c index d498a202..930dbb6f 100644 --- a/lib/src/clixon_json.c +++ b/lib/src/clixon_json.c @@ -691,8 +691,9 @@ int json_parse_str(char *str, cxobj **xt) { - if ((*xt = xml_new("top", NULL, NULL)) == NULL) - return -1; + if (*xt == NULL) + if ((*xt = xml_new("top", NULL, NULL)) == NULL) + return -1; return json_parse(str, "", *xt); }