Skip to content

Commit d54e545

Browse files
committed
orted/orted_submit: plug a memory leak
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 189da7f commit d54e545

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

orte/orted/orted_submit.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ int orte_submit_init(int argc, char *argv[],
588588
void orte_submit_finalize(void)
589589
{
590590
trackr_t *trk;
591-
int i;
591+
int i, rc;
592592

593593
for (i=0; i < tool_jobs.size; i++) {
594594
if (NULL != (trk = (trackr_t*)opal_pointer_array_get_item(&tool_jobs, i))) {
@@ -597,6 +597,17 @@ void orte_submit_finalize(void)
597597
}
598598
OBJ_DESTRUCT(&tool_jobs);
599599

600+
/* close the SCHIZO framework */
601+
if (ORTE_SUCCESS != (rc = mca_base_framework_close(&orte_schizo_base_framework))) {
602+
ORTE_ERROR_LOG(rc);
603+
return;
604+
}
605+
606+
/* finalize only the util portion of OPAL */
607+
if (OPAL_SUCCESS != (rc = opal_finalize_util())) {
608+
return;
609+
}
610+
600611
/* destruct the cmd line object */
601612
if (NULL != orte_cmd_line) {
602613
OBJ_RELEASE(orte_cmd_line);
@@ -615,6 +626,12 @@ void orte_submit_finalize(void)
615626
if (NULL != orte_cmd_options.prefix) {
616627
free(orte_cmd_options.prefix);
617628
}
629+
if (NULL != orte_launch_environ) {
630+
opal_argv_free(orte_launch_environ);
631+
}
632+
if (NULL != orte_basename) {
633+
free(orte_basename);
634+
}
618635
}
619636

620637
int orte_submit_cancel(int index) {

0 commit comments

Comments
 (0)