mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-13 01:31:18 +02:00
25667: free mstr before returning from errors.
This commit is contained in:
parent
430a7535fa
commit
06cc84ce84
2 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
||||||
2008-09-14 Clint Adams <clint@zsh.org>
|
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
|
* 25666: Src/Zle/computil.c: free memory allocated for an
|
||||||
xor if the argument number is invalid.
|
xor if the argument number is invalid.
|
||||||
|
|
||||||
|
|
|
@ -679,10 +679,12 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
|
||||||
p = "" - 1;
|
p = "" - 1;
|
||||||
} else {
|
} else {
|
||||||
zwarnnam(name, "number expected after -%c", *p);
|
zwarnnam(name, "number expected after -%c", *p);
|
||||||
|
zsfree(mstr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (dat.dummies < 0) {
|
if (dat.dummies < 0) {
|
||||||
zwarnnam(name, "invalid number: %d", dat.dummies);
|
zwarnnam(name, "invalid number: %d", dat.dummies);
|
||||||
|
zsfree(mstr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -691,6 +693,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
|
||||||
goto ca_args;
|
goto ca_args;
|
||||||
default:
|
default:
|
||||||
zwarnnam(name, "bad option: -%c", *p);
|
zwarnnam(name, "bad option: -%c", *p);
|
||||||
|
zsfree(mstr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (sp) {
|
if (sp) {
|
||||||
|
|
Loading…
Reference in a new issue