Fix a few valgrind-reported memory leaks
This commit was SVN r24498.
Этот коммит содержится в:
родитель
ec90a3ba6d
Коммит
06d5c59115
@ -369,6 +369,7 @@ static int fork_hnp(void)
|
||||
close(death_pipe[0]);
|
||||
close(death_pipe[1]);
|
||||
free(cmd);
|
||||
opal_argv_free(argv);
|
||||
return ORTE_ERR_SYS_LIMITS_CHILDREN;
|
||||
}
|
||||
|
||||
@ -412,6 +413,7 @@ static int fork_hnp(void)
|
||||
*/
|
||||
close(p[1]); /* parent closes the write - orted will write its contact info to it*/
|
||||
close(death_pipe[0]); /* parent closes the death_pipe's read */
|
||||
opal_argv_free(argv);
|
||||
|
||||
/* setup the buffer to read the name + uri */
|
||||
buffer_length = ORTE_URI_MSG_LGTH;
|
||||
|
@ -441,11 +441,14 @@ int orte_session_dir(bool create,
|
||||
/*
|
||||
* Update some of the global structures if they are empty
|
||||
*/
|
||||
if (NULL == orte_process_info.tmpdir_base)
|
||||
if (NULL == orte_process_info.tmpdir_base) {
|
||||
orte_process_info.tmpdir_base = strdup(local_prefix);
|
||||
}
|
||||
|
||||
if (NULL == orte_process_info.top_session_dir)
|
||||
if (NULL == orte_process_info.top_session_dir &&
|
||||
NULL != frontend) {
|
||||
orte_process_info.top_session_dir = strdup(frontend);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the process session directory
|
||||
@ -495,10 +498,15 @@ int orte_session_dir(bool create,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if(NULL != fulldirpath)
|
||||
if (NULL != local_prefix) {
|
||||
free(local_prefix);
|
||||
}
|
||||
if(NULL != fulldirpath) {
|
||||
free(fulldirpath);
|
||||
if(NULL != frontend)
|
||||
}
|
||||
if(NULL != frontend) {
|
||||
free(frontend);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user