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

PATCH: repost: memory leak, maybe.



I've had this patch lying around for ages.  It was supposed to fix
a memory leak, but we never proved this was the problem.  It's been
running on my home desktop without a problem, so I may run it up to
the top of the flagpole.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.50
diff -u -r1.50 compresult.c
--- Src/Zle/compresult.c	2 Jun 2004 22:15:01 -0000	1.50
+++ Src/Zle/compresult.c	11 Jul 2004 22:35:35 -0000
@@ -1768,6 +1768,9 @@
 		g->width += (max - (g->width * g->cols - CM_SPACE)) / g->cols;
 	}
     }
+    else
+	for (g = amatches; g; g = g->next)
+	    zfree(g->widths, 0);
     listdat.valid = 1;
     listdat.hidden = hidden;
     listdat.nlist = nlist;

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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