- **status**: review --> fixed


---

** [tickets:#2826] imm: potential leak of memory pointed to by ao_node in OM 
API**

**Status:** fixed
**Milestone:** 5.21.06
**Created:** Wed Apr 04, 2018 03:32 AM UTC by Vu Minh Nguyen
**Last Updated:** Thu Mar 25, 2021 08:34 AM UTC
**Owner:** Surbhi Tripathi


The allocated memory `ao_node` should be freed before going to `lock_fail` in 
below code:

    ::: C++
    /* Allocate the IMMA_ADMIN_OWNER_NODE & Populate */
    ao_node = calloc(1, sizeof(IMMA_ADMIN_OWNER_NODE));
    ...
    mds_send_fail:
          if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) {
            rc = SA_AIS_ERR_LIBRARY;
            **goto lock_fail;**
          }
          locked = true;
      
      admin_owner_node_free:
          if (ao_node != NULL) {
            free(ao_node);
            ao_node = NULL;
          }

    lock_fail:
          if (out_evt) free(out_evt);
          return rc;
        }


---

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