mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-19 11:31:26 +01:00
32932: add hmkarray() and use to fix leak
This commit is contained in:
parent
417cb94fe1
commit
b79ef8caaf
3 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-08-01 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 32932: Src/glob.c, Src/utils.c: add hmkarray() and
|
||||
use to fix leak.
|
||||
|
||||
2014-07-31 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 32931: Src/glob.c: with NO_NOMATCH, using a subscript glob
|
||||
|
|
|
@ -2935,7 +2935,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
|
|||
*/
|
||||
if (!vunset) {
|
||||
if (isarr) {
|
||||
aval = mkarray(NULL);
|
||||
aval = hmkarray(NULL);
|
||||
} else {
|
||||
val = dupstring("");
|
||||
}
|
||||
|
|
11
Src/utils.c
11
Src/utils.c
|
@ -3371,6 +3371,17 @@ mkarray(char *s)
|
|||
return t;
|
||||
}
|
||||
|
||||
/**/
|
||||
mod_export char **
|
||||
hmkarray(char *s)
|
||||
{
|
||||
char **t = (char **) zhalloc((s) ? (2 * sizeof s) : (sizeof s));
|
||||
|
||||
if ((*t = s))
|
||||
t[1] = NULL;
|
||||
return t;
|
||||
}
|
||||
|
||||
/**/
|
||||
mod_export void
|
||||
zbeep(void)
|
||||
|
|
Loading…
Reference in a new issue