Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: parse_cvdef shuffle
- X-seq: zsh-workers 25940
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: parse_cvdef shuffle
- Date: Wed, 29 Oct 2008 01:30:12 +0000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
This memory doesn't need to be allocated until after the (c == ':')
block, which could return without freeing it.
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.111
diff -u -r1.111 computil.c
--- Src/Zle/computil.c 18 Oct 2008 19:16:24 -0000 1.111
+++ Src/Zle/computil.c 29 Oct 2008 01:27:20 -0000
@@ -2905,13 +2905,6 @@
zwarnnam(nam, "invalid value definition: %s", *args);
return NULL;
}
- if (!multi) {
- if (!xor) {
- xor = (char **) zalloc(2 * sizeof(char *));
- xor[1] = NULL;
- }
- xor[xnum] = ztrdup(name);
- }
/* Get argument? */
if (c == ':') {
@@ -2930,6 +2923,13 @@
vtype = CVV_NOARG;
arg = NULL;
}
+ if (!multi) {
+ if (!xor) {
+ xor = (char **) zalloc(2 * sizeof(char *));
+ xor[1] = NULL;
+ }
+ xor[xnum] = ztrdup(name);
+ }
*valp = val = (Cvval) zalloc(sizeof(*val));
valp = &((*valp)->next);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author