about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-09-10 21:00:23 -0700
committerBart Schaefer <schaefer@zsh.org>2023-09-10 21:00:23 -0700
commit96ce0abf6b7607ca2df64759c495d153132d07bd (patch)
treed9ca5f807b28ba10cc9976fe31ded1d1f38dcac3
parentd95197a2ec43c79958aaf198189d4f138422a331 (diff)
downloadzsh-96ce0abf6b7607ca2df64759c495d153132d07bd.tar.gz
zsh-96ce0abf6b7607ca2df64759c495d153132d07bd.tar.xz
zsh-96ce0abf6b7607ca2df64759c495d153132d07bd.zip
52125: getoutput() must not free() after gettempname(..., 1) for heap
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 72922feb4..c8bc5e30f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-09-10  Bart Schaefer  <schaefer@zsh.org>
+
+	* 52125: Src/exec.c: getoutput() must not free() gettempname()
+
 2023-09-09  Bart Schaefer  <schaefer@zsh.org>
 
 	* unposted: Completion/Base/Utility/_shadow: quoting for safety
diff --git a/Src/exec.c b/Src/exec.c
index 8f9d5a885..3a8b3e951 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4897,7 +4897,6 @@ getoutputfile(char *cmd, char **eptr)
 
     if ((fd = open(nam, O_WRONLY | O_CREAT | O_EXCL | O_NOCTTY, 0600)) < 0) {
 	zerr("process substitution failed: %e", errno);
-	free(nam);
 	if (!s)
 	    child_unblock();
 	return NULL;