From 031dd01cf20ef231c7f26b262ae01e81e3d6eb34 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Wed, 29 Oct 2008 01:33:23 +0000 Subject: 25940: delay !multi memory allocation until after possibility to error out and return without freeing. --- Src/Zle/computil.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Src') 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); -- cgit 1.4.1