void mgmt_ds_reset_candidate(void)
{
struct lyd_node *dnode = mm->candidate_ds->root.cfg_root->dnode;
+
if (dnode)
yang_dnode_free(dnode);
*/
return NB_ERR_NOT_FOUND;
/* destroy dependant */
- if (nb_node->dep_cbs.get_dependant_xpath) {
+ if (nb_node && nb_node->dep_cbs.get_dependant_xpath) {
nb_node->dep_cbs.get_dependant_xpath(dnode, dep_xpath);
dep_dnode = yang_dnode_get(
ds_ctx->config_ds ? ds_ctx->root.cfg_root->dnode
- : ds_ctx->root.dnode_root,
+ : ds_ctx->root.dnode_root,
dep_xpath);
if (dep_dnode)
lyd_free_tree(dep_dnode);