summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-24 07:59:17 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-24 07:59:17 +0000
commited98c0bed8e554632b79b278d8251ac52c1dcfbc (patch)
tree344e48b551926a7eb74d60c400a5d41e65f26e7e
parent45af2f90f91fa1b3f3b326baa34272a4f045fb91 (diff)
downloadzsh-ed98c0bed8e554632b79b278d8251ac52c1dcfbc.tar.gz
zsh-ed98c0bed8e554632b79b278d8251ac52c1dcfbc.tar.xz
zsh-ed98c0bed8e554632b79b278d8251ac52c1dcfbc.zip
fix two memory leaks (found by Felix): pre-compiled patterns when re-defining styles and compredirs-copies in comp_wrapper() (17029)
-rw-r--r--ChangeLog6
-rw-r--r--Src/Modules/zutil.c1
-rw-r--r--Src/Zle/complete.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index db2ff2277..c5f9b94e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-24  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 17029: Src/Modules/zutil.c, Src/Zle/complete.c: fix two
+	memory leaks (found by Felix): pre-compiled patterns when
+	re-defining styles and compredirs-copies in comp_wrapper()
+
 2002-04-23  Bart Schaefer  <schaefer@zsh.org>
 
 	* users/4851: Functions/Misc/relative: new function inspired by
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index 85ab4b394..3443f870d 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -132,6 +132,7 @@ setstypat(Style s, char *pat, Patprog prog, char **vals, int eval)
 		freearray(p->vals);
 	    if (p->eval)
 		freeeprog(p->eval);
+            freepatprog(p->prog);
 	    p->vals = zarrdup(vals);
 	    p->eval = eprog;
 
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index a787528c2..e1051c30c 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -1320,6 +1320,7 @@ comp_wrapper(Eprog prog, FuncWrap w, char *name)
 	    zsfree(oqs);
 	    zsfree(oaq);
 	    freearray(owords);
+	    freearray(oredirs);
 	}
 	zsfree(comprestore);
 	comprestore = orest;