about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-06-27 12:50:40 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-06-27 12:50:40 -0700
commitef080283468cbd7b46ceb19c148cd0b9c4d52356 (patch)
tree3ef8cfac6e48b86bc6f27fbf5d16dba382121738 /Src/exec.c
parentb7aecf6c8ee6beb028f4f3f7548c1b899fc5bfae (diff)
downloadzsh-ef080283468cbd7b46ceb19c148cd0b9c4d52356.tar.gz
zsh-ef080283468cbd7b46ceb19c148cd0b9c4d52356.tar.xz
zsh-ef080283468cbd7b46ceb19c148cd0b9c4d52356.zip
35634: handle failure of gettempname() in namedpipe()
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 50a11eb54..39d132647 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4277,6 +4277,10 @@ namedpipe(void)
 {
     char *tnam = gettempname(NULL, 1);
 
+    if (!tnam) {
+	zerr("failed to create named pipe: %e", errno);
+	return NULL;
+    }
 # ifdef HAVE_MKFIFO
     if (mkfifo(tnam, 0600) < 0){
 # else