about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-05-19 10:30:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-05-19 10:30:42 +0000
commit6d9135befe12593ebc756cc7608d241cb892d096 (patch)
tree037b4c088701997302f4ba41850bdc05500655f2
parent09c5818b393a14d693e5b7424b23e0a155bcaa60 (diff)
downloadzsh-6d9135befe12593ebc756cc7608d241cb892d096.tar.gz
zsh-6d9135befe12593ebc756cc7608d241cb892d096.tar.xz
zsh-6d9135befe12593ebc756cc7608d241cb892d096.zip
18543: memory leak vared'ing arrays
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_main.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 234c46937..28305e91d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-19  Peter Stephenson  <pws@csr.com>
+
+	* 18548: Src/Zle/zle_main.c: memory leak when vared'ing arrays
+	spotted by valgrind (18543).
+
 2003-05-15  Oliver Kiddle  <opk@zsh.org>
 
 	* 18530: Src/builtin.c, Src/options.c, Doc/Zsh/builtins.yo:
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 1f2f07a09..8daf60085 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1177,9 +1177,10 @@ bin_vared(char *name, char **args, Options ops, int func)
 
 	/*
 	 * Use spacesplit with fourth argument 1: identify quoted separators,
-	 * unquote but don't split.
+	 * and unquote.  This duplicates the string, so we still need to free.
 	 */
 	a = spacesplit(t, 1, 0, 1);
+	zsfree(t);
 	if (PM_TYPE(pm->flags) == PM_ARRAY)
 	    setaparam(args[0], a);
 	else