summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mgmt_be_client.c1
-rw-r--r--lib/vty.c1
-rw-r--r--mgmtd/mgmt_txn.c7
3 files changed, 7 insertions, 2 deletions
diff --git a/lib/mgmt_be_client.c b/lib/mgmt_be_client.c
index 2445fe9d07..534dc43405 100644
--- a/lib/mgmt_be_client.c
+++ b/lib/mgmt_be_client.c
@@ -1072,6 +1072,7 @@ void mgmt_be_client_lib_destroy(void)
msg_client_cleanup(&client_ctx->client);
mgmt_be_cleanup_all_txns(client_ctx);
mgmt_be_txns_fini(&client_ctx->txn_head);
+ nb_config_free(client_ctx->candidate_config);
memset(client_ctx, 0, sizeof(*client_ctx));
}
diff --git a/lib/vty.c b/lib/vty.c
index 1e17f18a23..51c2ebdc55 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2472,6 +2472,7 @@ void vty_close(struct vty *vty)
if (vty->fd == STDIN_FILENO)
was_stdio = true;
+ XFREE(MTYPE_TMP, vty->pending_cmds_buf);
XFREE(MTYPE_VTY, vty->buf);
if (vty->error) {
diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c
index 93466a2b39..ef5e7e8e32 100644
--- a/mgmtd/mgmt_txn.c
+++ b/mgmtd/mgmt_txn.c
@@ -1090,8 +1090,8 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
&cfg_btch->data[cfg_btch->num_cfg_data]);
cfg_btch->cfg_data[cfg_btch->num_cfg_data].data =
&cfg_btch->data[cfg_btch->num_cfg_data];
- cfg_btch->data[cfg_btch->num_cfg_data].xpath = xpath;
- xpath = NULL;
+ cfg_btch->data[cfg_btch->num_cfg_data].xpath =
+ strdup(xpath);
mgmt_yang_data_value_init(
&cfg_btch->value[cfg_btch->num_cfg_data]);
@@ -1127,6 +1127,9 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
xpath);
MGMTD_TXN_ERR("***** %s", err_buf);
}
+
+ free(xpath);
+ xpath = NULL;
}
cmtcfg_req->cmt_stats->last_batch_cnt = num_chgs;