From 6d9135befe12593ebc756cc7608d241cb892d096 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 19 May 2003 10:30:42 +0000 Subject: 18543: memory leak vared'ing arrays --- ChangeLog | 5 +++++ Src/Zle/zle_main.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 234c46937..28305e91d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-05-19 Peter Stephenson + + * 18548: Src/Zle/zle_main.c: memory leak when vared'ing arrays + spotted by valgrind (18543). + 2003-05-15 Oliver Kiddle * 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 -- cgit 1.4.1