commit 0ef3528def6fea13daa1a7a07f34db4994a5e636 (HEAD -> develop,
origin/develop, ticket-2826)
Author: ztrisur <[email protected]>
Date: Thu Mar 25 09:46:03 2021 +1100
imm: potential leak of memory pointed to by ao_node in OM API [#2826]
---
** [tickets:#2826] imm: potential leak of memory pointed to by ao_node in OM
API**
**Status:** review
**Milestone:** 5.21.06
**Created:** Wed Apr 04, 2018 03:32 AM UTC by Vu Minh Nguyen
**Last Updated:** Wed Mar 24, 2021 02:28 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