1
0
Fork 0
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:
Peter Stephenson 2014-08-01 16:15:13 +01:00
parent 417cb94fe1
commit b79ef8caaf
3 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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("");
}

View file

@ -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)