summaryrefslogtreecommitdiff
path: root/src/posixos.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-31 01:48:33 -0400
committerPaul Smith <psmith@gnu.org>2022-10-31 02:23:04 -0400
commit38b19976f50af0c898030adcb86320bdfe52a159 (patch)
tree2f4d350dba8ac492185a28546535d9d5df71901c /src/posixos.c
parent1dd52ab472e9dffa0cbdcdc68f196b64ce2abfc4 (diff)
downloadmake-git-38b19976f50af0c898030adcb86320bdfe52a159.tar.gz
Fix issues found by ASAN and Coverity
* tests/test_driver.pl: Preserve the LSAN_OPTIONS variable. * tests/scripts/targets/ONESHELL: Don't set a local variable. * tests/scripts/functions/let: Test empty let variable. * src/posixos.c (osync_parse_mutex): Free existing osync_tmpfile. * src/misc.c (get_tmpfd): Set umask() before invoking mkstemp(). * src/ar.c (ar_parse_name): Check invalid name (shouldn't happen). * src/function.c (define_new_function): Free previous function entry when replacing it with a new one. * src/job.c (child_execute_job): Initialize pid for safety. (construct_command_argv_internal): In oneshell mode ensure that the returned argv has the right format (0th element is a pointer to the entire buffer).
Diffstat (limited to 'src/posixos.c')
-rw-r--r--src/posixos.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/posixos.c b/src/posixos.c
index 63201b40..44aeb346 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -673,6 +673,7 @@ osync_parse_mutex (const char *mutex)
return 0;
}
+ free (osync_tmpfile);
osync_tmpfile = xstrdup (mutex + CSTRLEN (MUTEX_PREFIX));
EINTRLOOP (osync_handle, open (osync_tmpfile, O_WRONLY));