Skip to content

Commit 64747a2

Browse files
committed
pml/cm: release datatype object in send completion callback
This change fixes a memory leak caused by not decreasing datatype object reference count when the send request completes. Signed-off-by: Wenduo Wang <wenduwan@amazon.com>
1 parent 970cf3a commit 64747a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/pml/cm/pml_cm_sendreq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ do {
455455
#define MCA_PML_CM_HVY_SEND_REQUEST_RETURN(sendreq) \
456456
{ \
457457
/* Let the base handle the reference counts */ \
458-
OMPI_DATATYPE_RETAIN(sendreq->req_send.req_base.req_datatype); \
458+
OMPI_DATATYPE_RELEASE(sendreq->req_send.req_base.req_datatype); \
459459
OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \
460460
OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \
461461
opal_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \
@@ -492,7 +492,7 @@ do { \
492492
#define MCA_PML_CM_THIN_SEND_REQUEST_RETURN(sendreq) \
493493
{ \
494494
/* Let the base handle the reference counts */ \
495-
OMPI_DATATYPE_RETAIN(sendreq->req_send.req_base.req_datatype); \
495+
OMPI_DATATYPE_RELEASE(sendreq->req_send.req_base.req_datatype); \
496496
OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \
497497
OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \
498498
opal_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \

0 commit comments

Comments
 (0)