From d54e54538a8c180ef01c05751b05621954e61f5f Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 22 Dec 2016 13:12:00 +0900 Subject: [PATCH] orted/orted_submit: plug a memory leak Signed-off-by: Gilles Gouaillardet --- orte/orted/orted_submit.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/orte/orted/orted_submit.c b/orte/orted/orted_submit.c index 2c29b90d14..9343868a10 100644 --- a/orte/orted/orted_submit.c +++ b/orte/orted/orted_submit.c @@ -588,7 +588,7 @@ int orte_submit_init(int argc, char *argv[], void orte_submit_finalize(void) { trackr_t *trk; - int i; + int i, rc; for (i=0; i < tool_jobs.size; i++) { if (NULL != (trk = (trackr_t*)opal_pointer_array_get_item(&tool_jobs, i))) { @@ -597,6 +597,17 @@ void orte_submit_finalize(void) } OBJ_DESTRUCT(&tool_jobs); + /* close the SCHIZO framework */ + if (ORTE_SUCCESS != (rc = mca_base_framework_close(&orte_schizo_base_framework))) { + ORTE_ERROR_LOG(rc); + return; + } + + /* finalize only the util portion of OPAL */ + if (OPAL_SUCCESS != (rc = opal_finalize_util())) { + return; + } + /* destruct the cmd line object */ if (NULL != orte_cmd_line) { OBJ_RELEASE(orte_cmd_line); @@ -615,6 +626,12 @@ void orte_submit_finalize(void) if (NULL != orte_cmd_options.prefix) { free(orte_cmd_options.prefix); } + if (NULL != orte_launch_environ) { + opal_argv_free(orte_launch_environ); + } + if (NULL != orte_basename) { + free(orte_basename); + } } int orte_submit_cancel(int index) {