diff --git a/mgmtd/mgmt_fe_adapter.c b/mgmtd/mgmt_fe_adapter.c index d98444703f21..6bcbe12416f7 100644 --- a/mgmtd/mgmt_fe_adapter.c +++ b/mgmtd/mgmt_fe_adapter.c @@ -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