mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 15:01:21 +02:00
25940: delay !multi memory allocation until after possibility to error out and return without freeing.
This commit is contained in:
parent
e775b4dd66
commit
031dd01cf2
@ -1,3 +1,8 @@
|
||||
2008-10-29 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 25940: Src/Zle/computil.c: delay !multi memory allocation until
|
||||
after possibility to error out and return without freeing.
|
||||
|
||||
2008-10-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 25938 (Mikael) + probably 25939, too:
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user