- **summary**: amfnd: fix leak memory in function avnd_di_object_upd_send() --> 
amfnd: memory leak in function avnd_di_object_upd_send()
- Description has changed:

Diff:

~~~~

--- old
+++ new
@@ -1,15 +1,5 @@
-- " msg.info.avd = static_cast<AVSV_DND_MSG >(calloc(1, 
sizeof(AVSVDNDMSG)));". It's used in the code bellow:
-                              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) {
-                                  rc = NCSCC_RC_FAILURE;
-                                  }
-                                LOG_NO(
-                                "avnd_di_object_upd_send() deferred as AMF 
director is offline(%d),"
-                                " or sync is required(%d)",
-                                cb->is_avd_down, cb->amfd_sync_required);
-
-                                TRACE_LEAVE2("AVD is down. %u", rc);
-                                return rc;
-                             } else {
-- but it hasn't been released memory after using.
+Mem leak reports
+/opensaf-code/src/amf/amfnd/di.cc:1090:12: Potential leak of memory pointed to 
by 'msg.info.avd' [unix.Malloc]
+      rc = NCSCC_RC_FAILURE;
+      
+The memory should be released if the message adds to the queue failed.

~~~~




---

** [tickets:#3273] amfnd: memory leak in function avnd_di_object_upd_send()**

**Status:** accepted
**Milestone:** 5.21.10
**Created:** Fri Jul 16, 2021 02:31 AM UTC by Huu The Truong
**Last Updated:** Tue Jul 20, 2021 02:14 AM UTC
**Owner:** Huu The Truong


Mem leak reports
/opensaf-code/src/amf/amfnd/di.cc:1090:12: Potential leak of memory pointed to 
by 'msg.info.avd' [unix.Malloc]
      rc = NCSCC_RC_FAILURE;
      
The memory should be released if the message adds to the queue failed.


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to