about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-10-30 20:29:55 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-10-30 20:29:55 +0000
commitb9500900b14102e87a57840a89b6714b8b7840d2 (patch)
treeb037821ef451344ef3616155bec4571df5ce7133
parent135211b00b887c20b08b149a66a8e800296ee29a (diff)
downloadzsh-b9500900b14102e87a57840a89b6714b8b7840d2.tar.gz
zsh-b9500900b14102e87a57840a89b6714b8b7840d2.tar.xz
zsh-b9500900b14102e87a57840a89b6714b8b7840d2.zip
25972: leaked and uninitialised memory found by valgrind
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/complete.c2
-rw-r--r--Src/Zle/compmatch.c1
3 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index dda2dbb04..6a9804c59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-10-30  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 25972: Src/Zle/complete.c, Src/Zle/compmatch.c: leaked
+	and uninitialised memory found by valgrind.
+
 	* 25971: Src/builtin.c, Src/zsh.h: fix 25937 which broke some
 	builtins that handle options themselves.
 
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 97d148b3a..bc56bc05a 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -464,7 +464,7 @@ parse_class(Cpattern p, char *iptr)
      * As the input string is metafied, but shouldn't contain shell
      * tokens, we can just add our own tokens willy nilly.
      */
-    optr = p->u.str = zalloc((optr-iptr) + 1);
+    optr = p->u.str = zhalloc((optr-iptr) + 1);
 
     while (firsttime || *iptr != endchar) {
 	int ch;
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index f92caa7bf..7a675a544 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -1687,6 +1687,7 @@ bld_line(Cmatcher mp, char **linep, char *mword, char *word, int wlen, int sfx)
     llen = mp->llen;
     rl = 0;
 
+    *line = '\0';
     if (sfx)
     {
 	/*