Skip to content

Commit

Permalink
mgmtd: msg is assigned yet never used again
Browse files Browse the repository at this point in the history
SA found this issue. let's clean this up.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 5, 2024
1 parent c2a37f8 commit 7cc33ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mgmtd/mgmt_fe_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,12 @@ static int fe_adapter_send_tree_data(struct mgmt_fe_session_ctx *session,
ret = yang_print_tree_append(&buf, tree, result_type,
(LYD_PRINT_WD_EXPLICIT |
LYD_PRINT_WITHSIBLINGS));
/* buf may have been reallocated and moved */
msg = (typeof(msg))buf;

/*
* Reminder buf may have been reallocated and moved
* so if msg is needed to be used again after this
* then reassign it.
* msg = (typeof(msg))buf;
*/

if (ret != LY_SUCCESS) {
MGMTD_FE_ADAPTER_ERR("Error building get-tree result for client %s session-id %" PRIu64
Expand Down

0 comments on commit 7cc33ef

Please sign in to comment.