summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-06-02 08:19:04 +0200
committerGitHub <noreply@github.com>2023-06-02 08:19:04 +0200
commit0f1a66f2c5d75688ee8843fd78da301b624711e2 (patch)
tree7895724e36191b3a0ba9503d724fac0975eb4559
parentMerge pull request #13641 from donaldsharp/com_list_str (diff)
parentmgmtd: xpath is already NULL in the failure path (diff)
downloadfrr-0f1a66f2c5d75688ee8843fd78da301b624711e2.tar.xz
frr-0f1a66f2c5d75688ee8843fd78da301b624711e2.zip
Merge pull request #13646 from donaldsharp/logically_illogical
mgmtd: xpath is already NULL in the failure path
-rw-r--r--mgmtd/mgmt_txn.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c
index bf5922433..3d818cb4c 100644
--- a/mgmtd/mgmt_txn.c
+++ b/mgmtd/mgmt_txn.c
@@ -1022,7 +1022,7 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
(void)mgmt_txn_send_commit_cfg_reply(
txn_req->txn, MGMTD_INTERNAL_ERROR,
"Internal error! Could not get Xpath from Ds node!");
- goto mgmt_txn_create_config_batches_failed;
+ return -1;
}
value = (char *)lyd_get_value(chg->cb.dnode);
@@ -1130,18 +1130,11 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
(void)mgmt_txn_send_commit_cfg_reply(
txn_req->txn, MGMTD_NO_CFG_CHANGES,
"No changes found to commit!");
- goto mgmt_txn_create_config_batches_failed;
+ return -1;
}
cmtcfg_req->next_phase = MGMTD_COMMIT_PHASE_TXN_CREATE;
return 0;
-
-mgmt_txn_create_config_batches_failed:
-
- if (xpath)
- free(xpath);
-
- return -1;
}
static int mgmt_txn_prepare_config(struct mgmt_txn_ctx *txn)