From 330003361b57df313557ab6b0899560fb86ce8a5 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 14 Aug 2007 21:12:00 +0000 Subject: [PATCH] * Free memory from asprintf * need to compare ERANGE to errno This commit was SVN r15860. --- orte/mca/pls/tm/pls_tm_module.c | 1 + orte/tools/orted/orted.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/orte/mca/pls/tm/pls_tm_module.c b/orte/mca/pls/tm/pls_tm_module.c index 2b886d4869..c8dd54ccda 100644 --- a/orte/mca/pls/tm/pls_tm_module.c +++ b/orte/mca/pls/tm/pls_tm_module.c @@ -246,6 +246,7 @@ static int pls_tm_launch_job(orte_jobid_t jobid) umask(current_umask); asprintf(&var, "0%o", current_umask); opal_setenv("ORTE_DAEMON_UMASK_VALUE", var, true, &env); + free(var); /* If we have a prefix, then modify the PATH and LD_LIBRARY_PATH environment variables. We only allow diff --git a/orte/tools/orted/orted.c b/orte/tools/orted/orted.c index 421ccce7ee..e91552c7f2 100644 --- a/orte/tools/orted/orted.c +++ b/orte/tools/orted/orted.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) if (NULL != umask_str) { char *endptr; long mask = strtol(umask_str, &endptr, 8); - if ((! (0 == mask && (EINVAL == errno || ERANGE))) && + if ((! (0 == mask && (EINVAL == errno || ERANGE == errno))) && (*endptr == '\0')) { umask(mask); }