Skip to content

Commit

Permalink
Merge pull request #12061 from jsquyres/pr/v5.0.x/fix-minor-memory-leaks
Browse files Browse the repository at this point in the history
v5.0.x: Fix minor memory leaks
  • Loading branch information
janjust authored Nov 16, 2023
2 parents 0455315 + 85497b0 commit 0473d58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions ompi/mca/pml/ob1/pml_ob1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Copyright (c) 2018-2021 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -382,18 +383,17 @@ int mca_pml_ob1_add_procs(ompi_proc_t** procs, size_t nprocs)
if(nprocs == 0)
return OMPI_SUCCESS;

OBJ_CONSTRUCT(&reachable, opal_bitmap_t);
rc = opal_bitmap_init(&reachable, (int)nprocs);
if(OMPI_SUCCESS != rc)
return rc;

/* make sure remote procs are using the same PML as us */
if (OMPI_SUCCESS != (rc = mca_pml_base_pml_check_selected("ob1",
procs,
nprocs))) {
return rc;
}

if (NULL == mca_bml.bml_add_procs) {
return OMPI_ERR_UNREACH;
}

OBJ_CONSTRUCT(&reachable, opal_bitmap_t);
rc = opal_bitmap_init(&reachable, (int)nprocs);
if (OMPI_SUCCESS != rc) {
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/base/mca_base_framework.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2018 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -246,9 +247,11 @@ int mca_base_framework_close(struct mca_base_framework_t *framework)

/* close the framework and all of its components */
if (is_open) {
ret = OPAL_SUCCESS;
if (NULL != framework->framework_close) {
ret = framework->framework_close();
} else {
}
if (OPAL_SUCCESS == ret) {
ret = mca_base_framework_components_close(framework, NULL);
}

Expand Down
4 changes: 3 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 Expand Up @@ -667,6 +668,7 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
"btl: tcp: Using interface: %s ", argv[i]);
opal_argv_append(&interface_count, &interfaces, argv[i]);
}
free(argv[i]);
continue;
}

Expand Down

0 comments on commit 0473d58

Please sign in to comment.