Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.0.x: Fix minor memory leaks #12061

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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