Skip to content

Commit b2a2be0

Browse files
committed
odls: fix memory leak plug
This fixes commit e2c343c.
1 parent 63d73a5 commit b2a2be0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

orte/mca/odls/base/odls_base_default_fns.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* All rights reserved.
1616
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
1717
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
18-
* Copyright (c) 2014-2016 Research Organization for Information Science
18+
* Copyright (c) 2014 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* $COPYRIGHT$
2121
*
@@ -642,6 +642,7 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
642642
int rc=ORTE_SUCCESS;
643643
orte_std_cntr_t proc_rank;
644644
char basedir[MAXPATHLEN];
645+
char **argvsav=NULL;
645646
int inm, j, idx;
646647
int total_num_local_procs = 0;
647648
orte_odls_launch_local_t *caddy = (orte_odls_launch_local_t*)cbdata;
@@ -815,7 +816,6 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
815816

816817
/* okay, now let's launch all the local procs for this app using the provided fork_local fn */
817818
for (proc_rank = 0, idx=0; idx < orte_local_children->size; idx++) {
818-
char **argvsav=NULL;
819819
if (NULL == (child = (orte_proc_t*)opal_pointer_array_get_item(orte_local_children, idx))) {
820820
continue;
821821
}
@@ -913,6 +913,9 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
913913
}
914914
/* don't have enough - wait a little time */
915915
ORTE_DETECT_TIMEOUT(1000, 1000, -1, timer_cb, caddy);
916+
if (NULL != argvsav) {
917+
opal_argv_free(argvsav);
918+
}
916919
return;
917920
}
918921
}
@@ -1100,6 +1103,9 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
11001103
*/
11011104
chdir(basedir);
11021105
}
1106+
if (NULL != argvsav) {
1107+
opal_argv_free(argvsav);
1108+
}
11031109

11041110
GETOUT:
11051111
/* tell the state machine that all local procs for this job

0 commit comments

Comments
 (0)