*/
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);
mgmt_realtime_to_string(&cmt_recd_tv, new->time_str,
sizeof(new->time_str));
mgmt_history_hash(new->time_str, new->cmtid_str);
- snprintf(new->cmt_json_file, sizeof(new->cmt_json_file),
+ snprintf(new->cmt_json_file, sizeof(new->cmt_json_file) - 1,
MGMTD_COMMIT_FILE_PATH, new->cmtid_str);
if (mgmt_cmt_infos_count(&mm->cmts) == MGMTD_MAX_COMMIT_LIST) {
struct mgmt_txn_req *txn_req,
struct mgmt_ds_ctx *ds_ctx)
{
- struct mgmt_txn_reqs_head *req_list = NULL;
- struct mgmt_txn_reqs_head *pending_list = NULL;
int indx;
struct mgmt_get_data_req *get_data;
struct mgmt_get_data_reply *get_reply;
- switch (txn_req->req_event) {
- case MGMTD_TXN_PROC_GETCFG:
- req_list = &txn->get_cfg_reqs;
- break;
- case MGMTD_TXN_PROC_GETDATA:
- req_list = &txn->get_data_reqs;
- break;
- case MGMTD_TXN_PROC_SETCFG:
- case MGMTD_TXN_PROC_COMMITCFG:
- case MGMTD_TXN_COMMITCFG_TIMEOUT:
- case MGMTD_TXN_CLEANUP:
- assert(!"Wrong txn request type!");
- break;
- }
-
get_data = txn_req->req.get_data;
if (!get_data->reply) {
mgmt_txn_get_config_failed:
- if (pending_list) {
- /*
- * Move the transaction to corresponding pending list.
- */
- if (req_list)
- mgmt_txn_reqs_del(req_list, txn_req);
- txn_req->pending_be_proc = true;
- mgmt_txn_reqs_add_tail(pending_list, txn_req);
- MGMTD_TXN_DBG(
- "Moved Req: %p for Txn: %p from Req-List to Pending-List",
- txn_req, txn_req->txn);
- } else {
- /*
- * Delete the txn request. It will also remove it from request
- * list.
- */
- mgmt_txn_req_free(&txn_req);
- }
+ /*
+ * Delete the txn request. It will also remove it from request
+ * list.
+ */
+ mgmt_txn_req_free(&txn_req);
return 0;
}