about summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-10-29 01:33:23 +0000
committerClint Adams <clint@users.sourceforge.net>2008-10-29 01:33:23 +0000
commit031dd01cf20ef231c7f26b262ae01e81e3d6eb34 (patch)
tree78d69f29eb3eaa49190cb0a3af4d3810aa9d639e /Src/Zle/computil.c
parente775b4dd669fdd377ca054fc69e4eb0b882acc2c (diff)
downloadzsh-031dd01cf20ef231c7f26b262ae01e81e3d6eb34.tar.gz
zsh-031dd01cf20ef231c7f26b262ae01e81e3d6eb34.tar.xz
zsh-031dd01cf20ef231c7f26b262ae01e81e3d6eb34.zip
25940: delay !multi memory allocation until after possibility to error out and return without freeing.
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e70a05f1a..056a611ac 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2905,13 +2905,6 @@ parse_cvdef(char *nam, char **args)
 	    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 @@ parse_cvdef(char *nam, char **args)
 	    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);