about summary refs log tree commit diff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-02 08:09:26 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-02 08:09:26 +0000
commited708a901be74fe49c6357db0b10f5bf451edadf (patch)
tree79a6e56037068b04fe2d9fd0d89348e09354e526 /Src/Zle/complete.c
parent040aca2023a0f6d09498b6469ca1bd16b7bc0068 (diff)
downloadzsh-ed708a901be74fe49c6357db0b10f5bf451edadf.tar.gz
zsh-ed708a901be74fe49c6357db0b10f5bf451edadf.tar.xz
zsh-ed708a901be74fe49c6357db0b10f5bf451edadf.zip
fix some memory leaks (thanks, Felix) (11722)
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c10
1 files changed, 6 insertions, 4 deletions
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;
 		}