mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 03:10:53 +00:00
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>
This commit is contained in:
parent
352cc841d8
commit
4da08e016b
@ -696,14 +696,14 @@ int nb_candidate_edit(struct nb_config *candidate,
|
|||||||
NULL, LYD_NEW_PATH_UPDATE,
|
NULL, LYD_NEW_PATH_UPDATE,
|
||||||
&dep_dnode);
|
&dep_dnode);
|
||||||
/* Create default nodes */
|
/* Create default nodes */
|
||||||
if (!err)
|
if (!err && dep_dnode)
|
||||||
err = lyd_new_implicit_tree(
|
err = lyd_new_implicit_tree(
|
||||||
dep_dnode,
|
dep_dnode,
|
||||||
LYD_IMPLICIT_NO_STATE, NULL);
|
LYD_IMPLICIT_NO_STATE, NULL);
|
||||||
if (err) {
|
if (err) {
|
||||||
flog_warn(
|
flog_warn(
|
||||||
EC_LIB_LIBYANG,
|
EC_LIB_LIBYANG,
|
||||||
"%s: lyd_new_path(%s) failed: %d",
|
"%s: dependency: lyd_new_path(%s) failed: %d",
|
||||||
__func__, dep_xpath, err);
|
__func__, dep_xpath, err);
|
||||||
return NB_ERR;
|
return NB_ERR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user