about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-09-14 09:00:26 +0000
committerClint Adams <clint@users.sourceforge.net>2008-09-14 09:00:26 +0000
commit06cc84ce849c2e28286ea68aed02cb8df2fb9ab7 (patch)
tree7ef6707ede97815de73a4d92f8a91bc3cd605d3d
parent430a7535fa73917418713fb714840fc2ae0c3e4c (diff)
downloadzsh-06cc84ce849c2e28286ea68aed02cb8df2fb9ab7.tar.gz
zsh-06cc84ce849c2e28286ea68aed02cb8df2fb9ab7.tar.xz
zsh-06cc84ce849c2e28286ea68aed02cb8df2fb9ab7.zip
25667: free mstr before returning from errors.
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/complete.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index afff490d8..d70fb004e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-09-14  Clint Adams  <clint@zsh.org>
 
+	* 25667: Src/Zle/complete.c: free mstr before returning from
+	errors.
+
 	* 25666: Src/Zle/computil.c: free memory allocated for an
 	xor if the argument number is invalid.
 
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 4b947834b..60c917853 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -679,10 +679,12 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
                     p = "" - 1;
                 } else {
                     zwarnnam(name, "number expected after -%c", *p);
+		    zsfree(mstr);
                     return 1;
                 }
                 if (dat.dummies < 0) {
                     zwarnnam(name, "invalid number: %d", dat.dummies);
+		    zsfree(mstr);
                     return 1;
                 }
 		break;
@@ -691,6 +693,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 		goto ca_args;
 	    default:
 		zwarnnam(name, "bad option: -%c", *p);
+		zsfree(mstr);
 		return 1;
 	    }
 	    if (sp) {