]> git.proxmox.com Git - mirror_frr.git/blobdiff - mgmtd/mgmt_ds.c
Merge pull request #13149 from pushpasis/mgmt_cleanup_zlog
[mirror_frr.git] / mgmtd / mgmt_ds.c
index 2cc921cb679d4fad5bf98aefde64d8a291c4d778..05a67a89cd56b9c5c520933d42bb1f403ee61574 100644 (file)
@@ -174,6 +174,7 @@ static int mgmt_ds_load_cfg_from_file(const char *filepath,
 void mgmt_ds_reset_candidate(void)
 {
        struct lyd_node *dnode = mm->candidate_ds->root.cfg_root->dnode;
+
        if (dnode)
                yang_dnode_free(dnode);
 
@@ -499,12 +500,12 @@ int mgmt_ds_delete_data_nodes(struct mgmt_ds_ctx *ds_ctx, const char *xpath)
                 */
                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);