Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: potential memory leak in bin_compadd



On Sun, Sep 14, 2008 at 08:36:01AM +0000, Clint Adams wrote:
> mstr might be allocated in an earlier run of the loop, and then not
> freed on these errors.

Missed one.

Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.41
diff -u -r1.41 complete.c
--- Src/Zle/complete.c	14 Sep 2008 09:00:37 -0000	1.41
+++ Src/Zle/complete.c	23 Sep 2008 19:25:07 -0000
@@ -708,6 +708,7 @@
 		    p = "" - 1;
 		} else {
 		    zwarnnam(name, e, *p);
+		    zsfree(mstr);
 		    return 1;
 		}
 		if (dm) {



Messages sorted by: Reverse Date, Date, Thread, Author