summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/compcore.c1
-rw-r--r--Src/Zle/complete.c10
2 files changed, 7 insertions, 4 deletions
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;
 		}