Skip to content

Commit 16526a2

Browse files
committed
btl/tcp: fix minor memory leak
When tearing down the BTL TCP component, use the handy OPAL_LIST_DESTRUCT macro to OBJ_RELEASE all elements of the mca_btl_tcp_component.local_ifs list and then OBJ_DESTRUCT -- not OBJ_RELEASE -- the list itself. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent 9f67859 commit 16526a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opal/mca/btl/tcp/btl_tcp_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Copyright (c) 2014-2017 Research Organization for Information Science
2121
* and Technology (RIST). All rights reserved.
2222
* Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
23+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
2324
* $COPYRIGHT$
2425
*
2526
* Additional copyrights may follow
@@ -472,7 +473,7 @@ static int mca_btl_tcp_component_close(void)
472473
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_max);
473474
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_user);
474475
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_lock);
475-
OBJ_DESTRUCT(&mca_btl_tcp_component.local_ifs);
476+
OPAL_LIST_DESTRUCT(&mca_btl_tcp_component.local_ifs);
476477

477478
return OPAL_SUCCESS;
478479
}

0 commit comments

Comments
 (0)