Fix a couple of minor memory leaks
This commit was SVN r14166.
Этот коммит содержится в:
родитель
bc1b046e33
Коммит
ce6b44d476
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* Corporation. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
@ -169,11 +169,13 @@ int mca_base_param_recache_files(bool rel_path_search)
|
|||||||
#else
|
#else
|
||||||
home = getenv("USERPROFILE");
|
home = getenv("USERPROFILE");
|
||||||
#endif /* !defined(__WINDOWS__) */
|
#endif /* !defined(__WINDOWS__) */
|
||||||
|
|
||||||
cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);
|
if(NULL == cwd) {
|
||||||
if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) )) {
|
cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);
|
||||||
opal_output(0, "Error: Unable to get the current working directory\n");
|
if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) )) {
|
||||||
cwd = strdup(".");
|
opal_output(0, "Error: Unable to get the current working directory\n");
|
||||||
|
cwd = strdup(".");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
asprintf(&files,
|
asprintf(&files,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* Corporation. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
@ -115,6 +115,7 @@ int opal_setenv(const char *name, const char *value, bool overwrite,
|
|||||||
} else if (NULL == *env) {
|
} else if (NULL == *env) {
|
||||||
i = 0;
|
i = 0;
|
||||||
opal_argv_append(&i, env, newvalue);
|
opal_argv_append(&i, env, newvalue);
|
||||||
|
free(newvalue);
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user