Skip to content

Commit 9f67859

Browse files
committed
mca_base_framework: fix minor memory leak
Even if a framework has its own framework_close function, we still have to mca_base_component_unload() each component (which will be handled safely/properly, regardless of whether the component is statically linked or was opened dynamically) and then remove that component from the framework's list of components. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent d89c462 commit 9f67859

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

opal/mca/base/mca_base_framework.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
88
* Copyright (c) 2018 Triad National Security, LLC. All rights
99
* reserved.
10+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1011
* $COPYRIGHT$
1112
*
1213
* Additional copyrights may follow
@@ -246,9 +247,11 @@ int mca_base_framework_close(struct mca_base_framework_t *framework)
246247

247248
/* close the framework and all of its components */
248249
if (is_open) {
250+
ret = OPAL_SUCCESS;
249251
if (NULL != framework->framework_close) {
250252
ret = framework->framework_close();
251-
} else {
253+
}
254+
if (OPAL_SUCCESS == ret) {
252255
ret = mca_base_framework_components_close(framework, NULL);
253256
}
254257

0 commit comments

Comments
 (0)