summaryrefslogtreecommitdiffstats
path: root/lib/northbound.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-06-11 15:18:24 +0200
committerChristian Hopps <chopps@labn.net>2021-06-12 11:10:18 +0200
commit4da08e016b5753558ffe61db532af8a2f9b6a8a5 (patch)
treefc88ebf07e3c2877052703c6b5159dc767674bd4 /lib/northbound.c
parentMerge pull request #8831 from sworleys/Fix-No-Ospf-Func (diff)
downloadfrr-4da08e016b5753558ffe61db532af8a2f9b6a8a5.tar.xz
frr-4da08e016b5753558ffe61db532af8a2f9b6a8a5.zip
lib: do not attempt to create default nodes from NULL tree node
Perform same NULL check for dependent node creation code too. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound.c')
-rw-r--r--lib/northbound.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index 47af77018..6edd5184e 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -696,14 +696,14 @@ int nb_candidate_edit(struct nb_config *candidate,
NULL, LYD_NEW_PATH_UPDATE,
&dep_dnode);
/* Create default nodes */
- if (!err)
+ if (!err && dep_dnode)
err = lyd_new_implicit_tree(
dep_dnode,
LYD_IMPLICIT_NO_STATE, NULL);
if (err) {
flog_warn(
EC_LIB_LIBYANG,
- "%s: lyd_new_path(%s) failed: %d",
+ "%s: dependency: lyd_new_path(%s) failed: %d",
__func__, dep_xpath, err);
return NB_ERR;
}