about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/compcore.c1
-rw-r--r--Src/Zle/complete.c10
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d2f2df925..a5dc6e186 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-02  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 11722: Src/Zle/compcore.c, Src/Zle/complete.c: fix some memory
+ 	leaks (thanks, Felix)
+	
 2000-06-02  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* 11717: Src/glob.c, Src/params.c, Src/subst.c, Src/zsh.h,
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index ded5c3b31..df7e67e59 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2879,6 +2879,7 @@ freematches(Cmgroup g)
 
 	for (m = g->matches; *m; m++)
 	    freematch(*m, g->nbrbeg, g->nbrend);
+	free(g->matches);
 
 	if (g->ylist)
 	    freearray(g->ylist);
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 6054f2ac1..1a659f781 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -291,7 +291,7 @@ parse_cmatcher(char *name, char *s)
 	if (err)
 	    return pcm_err;
 
-	n = (Cmatcher) zcalloc(sizeof(*ret));
+	n = (Cmatcher) hcalloc(sizeof(*ret));
 	n->next = NULL;
 	n->flags = fl;
 	n->line = line;
@@ -568,9 +568,11 @@ bin_compadd(char *name, char **argv, char *ops, int func)
 		    return 1;
 		}
 		if (dm) {
-		    if (mstr)
-			mstr = tricat(mstr, " ", m);
-		    else
+		    if (mstr) {
+			char *tmp = tricat(mstr, " ", m);
+			zsfree(mstr);
+			mstr = tmp;
+		    } else
 			mstr = ztrdup(m);
 		    m = NULL;
 		}