From 841ed962f6261bba854551d777c39c695d264374 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Fri, 9 Aug 2013 19:50:28 +0000 Subject: [PATCH] fix MCA variable and component system leaks cmr=v1.7.3:reviewer=rhc This commit was SVN r29011. --- opal/mca/base/mca_base_framework.c | 6 ++++++ opal/mca/base/mca_base_var.c | 1 + orte/mca/plm/alps/plm_alps_component.c | 2 +- orte/runtime/orte_mca_params.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/opal/mca/base/mca_base_framework.c b/opal/mca/base/mca_base_framework.c index 636c04d21a..1d4e7da871 100644 --- a/opal/mca/base/mca_base_framework.c +++ b/opal/mca/base/mca_base_framework.c @@ -193,9 +193,15 @@ int mca_base_framework_close (struct mca_base_framework_t *framework) { return ret; } } else { + opal_list_item_t *item; + while (NULL != (item = opal_list_remove_first (&framework->framework_components))) { + OBJ_RELEASE(item); + } ret = OPAL_SUCCESS; } + framework->framework_flags &= ~MCA_BASE_FRAMEWORK_FLAG_REGISTERED; + framework_close_output (framework); return ret; diff --git a/opal/mca/base/mca_base_var.c b/opal/mca/base/mca_base_var.c index b7590e96bb..99666272ea 100644 --- a/opal/mca/base/mca_base_var.c +++ b/opal/mca/base/mca_base_var.c @@ -1888,6 +1888,7 @@ int mca_base_var_dump(int index, char ***out, mca_base_var_dump_type_t output_ty tmp = out[0][0]; if (VAR_IS_DEPRECATED(var[0])) { asprintf (out[0], "%s, deprecated", tmp); + free (tmp); tmp = out[0][0]; } diff --git a/orte/mca/plm/alps/plm_alps_component.c b/orte/mca/plm/alps/plm_alps_component.c index 16f7aa3f2d..8aa897eec8 100644 --- a/orte/mca/plm/alps/plm_alps_component.c +++ b/orte/mca/plm/alps/plm_alps_component.c @@ -110,7 +110,7 @@ static int plm_alps_register(void) MCA_BASE_VAR_SCOPE_READONLY, &mca_plm_alps_component.priority); - mca_plm_alps_component.aprun_cmd = strdup ("aprun"); + mca_plm_alps_component.aprun_cmd = "aprun"; (void) mca_base_component_var_register (comp, "aprun", "Command to run instead of aprun", MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_9, diff --git a/orte/runtime/orte_mca_params.c b/orte/runtime/orte_mca_params.c index 035a1cf608..2b102576fb 100644 --- a/orte/runtime/orte_mca_params.c +++ b/orte/runtime/orte_mca_params.c @@ -519,7 +519,7 @@ int orte_register_params(void) #endif /* allow specification of the launch agent */ - orte_launch_agent = strdup ("orted"); + orte_launch_agent = "orted"; (void) mca_base_var_register ("orte", "orte", NULL, "launch_agent", "Command used to start processes on remote nodes (default: orted)", MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,