Skip to content

Commit be41b12

Browse files
committed
orted: plug misc memory leaks
as reported by Coverity with CID 1362603 and 1362606
1 parent cd2b5a8 commit be41b12

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

orte/orted/orted_comm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1616
* Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved.
1717
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
18+
* Copyright (c) 2016 Research Organization for Information Science
19+
* and Technology (RIST). All rights reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -1145,6 +1147,9 @@ void orte_daemon_recv(int status, orte_process_name_t* sender,
11451147
OBJ_RELEASE(relay_msg);
11461148
}
11471149
}
1150+
if (NULL != gstack_exec) {
1151+
free(gstack_exec);
1152+
}
11481153
/* always send our response */
11491154
if (0 > (ret = orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, answer,
11501155
ORTE_RML_TAG_STACK_TRACE,

orte/orted/orted_submit.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
18-
* Copyright (c) 2015 Research Organization for Information Science
18+
* Copyright (c) 2015-2016 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* $COPYRIGHT$
2121
*
@@ -1291,7 +1291,7 @@ static int create_app(int argc, char* argv[],
12911291
char *param, *value;
12921292
orte_app_context_t *app = NULL;
12931293
bool found = false;
1294-
char *appname;
1294+
char *appname = NULL;
12951295

12961296
*made_app = false;
12971297

@@ -1704,7 +1704,6 @@ static int create_app(int argc, char* argv[],
17041704
free(value);
17051705
}
17061706
}
1707-
free(appname);
17081707

17091708
*app_ptr = app;
17101709
app = NULL;
@@ -1716,6 +1715,9 @@ static int create_app(int argc, char* argv[],
17161715
if (NULL != app) {
17171716
OBJ_RELEASE(app);
17181717
}
1718+
if (NULL != appname) {
1719+
free(appname);
1720+
}
17191721
return rc;
17201722
}
17211723

0 commit comments

Comments
 (0)