1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-20 06:56:05 +02:00

34965: consistent use of zalloc/zrealloc/zfree

This commit is contained in:
Barton E. Schaefer 2015-04-25 12:40:35 -07:00
parent fd574101a9
commit fae07f65a3
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
2015-04-25 Barton E. Schaefer <schaefer@zsh.org>
* 34965: Src/glob.c: consistent use of zalloc/zrealloc/zfree
* 34961: Completion/Unix/Command/_mkdir: avoid _message because
it aborts completer list too early

View File

@ -437,7 +437,7 @@ insert(char *s, int checked)
matchptr++;
if (++matchct == matchsz) {
matchbuf = (Gmatch )realloc((char *)matchbuf,
matchbuf = (Gmatch)zrealloc((char *)matchbuf,
sizeof(struct gmatch) * (matchsz *= 2));
matchptr = matchbuf + matchct;
@ -1818,7 +1818,7 @@ zglob(LinkList list, LinkNode np, int nountok)
badcshglob |= 1; /* at least one cmd. line expansion failed */
} else if (isset(NOMATCH)) {
zerr("no matches found: %s", ostr);
free(matchbuf);
zfree(matchbuf, 0);
restore_globstate(saved);
return;
} else {
@ -1923,7 +1923,7 @@ zglob(LinkList list, LinkNode np, int nountok)
} else if (!badcshglob && !isset(NOMATCH) && matchct == 1) {
insert_glob_match(list, node, (--matchptr)->name);
}
free(matchbuf);
zfree(matchbuf, 0);
restore_globstate(saved);
}