about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/builtin.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f58df1fa..a000719c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-01-06  Mikael Magnusson  <mikachu@gmail.com>
 
+	* 34113: Src/builtin.c: whence: use dupstring to not leak memory
+
 	* 34119: Src/Zle/complist.c: Fix leak of string in clnicezputs
 
 	* 34105: Src/subst.c: remove dead code
diff --git a/Src/builtin.c b/Src/builtin.c
index afa836a03..228eaaada 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3323,7 +3323,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 	    for (pp = path; *pp; pp++) {
 		if (**pp) {
 		    buf = zhtricat(*pp, "/", *argv);
-		} else buf = ztrdup(*argv);
+		} else buf = dupstring(*argv);
 
 		if (iscom(buf)) {
 		    if (wd) {