Ack with minor comment.
Should update commit msg to common.
-----Original Message-----
From: Huu The Truong <[email protected]>
Sent: Tuesday, July 20, 2021 12:02 PM
To: Thang Duc Nguyen <[email protected]>; Minh Hon Chau
<[email protected]>
Cc: [email protected]; Huu The Truong
<[email protected]>
Subject: [PATCH 1/1] amf: fix leak memory in function avnd_di_object_upd_send()
[#3273]
The leak memory is happened by variable "msg.info.avd".
It hasn't been released memory after using.
Use function avnd_di_msg_send() to release if 'avnd_diq_rec_add() == nullptr'
---
src/amf/amfnd/di.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/amf/amfnd/di.cc b/src/amf/amfnd/di.cc index
a2f573ad2..40229438d 100644
--- a/src/amf/amfnd/di.cc
+++ b/src/amf/amfnd/di.cc
@@ -1087,6 +1087,8 @@ uint32_t avnd_di_object_upd_send(AVND_CB *cb,
AVSV_PARAM_INFO *param) {
if ((cb->is_avd_down == false) && (cb->amfd_sync_required == true)) {
msg.info.avd->msg_info.n2d_data_req.msg_id = 0;
if (avnd_diq_rec_add(cb, &msg) == nullptr) {
+ /* free the contents of avnd message */
+ avnd_msg_content_free(cb, &msg);
rc = NCSCC_RC_FAILURE;
}
LOG_NO(
--
2.25.1
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel