Skip to content

Commit

Permalink
btl/tcp: fix minor memory leak
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jsquyres committed Oct 30, 2023
1 parent e3d7477 commit b1eb748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opal/mca/btl/tcp/btl_tcp_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -472,7 +473,7 @@ static int mca_btl_tcp_component_close(void)
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_max);
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_user);
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_lock);
OBJ_DESTRUCT(&mca_btl_tcp_component.local_ifs);
OPAL_LIST_DESTRUCT(&mca_btl_tcp_component.local_ifs);

return OPAL_SUCCESS;
}
Expand Down

0 comments on commit b1eb748

Please sign in to comment.