1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

34108: Don't leak ifs stuff

Found by Coverity (Issue 1255785).
This commit is contained in:
Mikael Magnusson 2015-01-06 04:32:07 +01:00
parent 6a5339fdd5
commit c425cc9632
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,7 @@
2015-01-06 Mikael Magnusson <mikachu@gmail.com>
* 34108: Src/utils.c: Don't leak ifs stuff
* 34107: Src/hist.c: getsubsargs: free ptr1 before returning
* 34134: Src/exec.c: anon funcs: don't leak shf and related data

View file

@ -3543,7 +3543,7 @@ inittyptab(void)
for (t0 = (int)STOUC(Snull); t0 <= (int)STOUC(Nularg); t0++)
typtab[t0] |= ITOK | IMETA | INULL;
for (s = ifs ? ifs : EMULATION(EMULATE_KSH|EMULATE_SH) ?
ztrdup(DEFAULT_IFS_SH) : ztrdup(DEFAULT_IFS); *s; s++) {
DEFAULT_IFS_SH : DEFAULT_IFS; *s; s++) {
int c = STOUC(*s == Meta ? *++s ^ 32 : *s);
#ifdef MULTIBYTE_SUPPORT
if (!isascii(c)) {
@ -3578,7 +3578,7 @@ inittyptab(void)
#ifdef MULTIBYTE_SUPPORT
set_widearray(wordchars, &wordchars_wide);
set_widearray(ifs ? ifs : EMULATION(EMULATE_KSH|EMULATE_SH) ?
ztrdup(DEFAULT_IFS_SH) : ztrdup(DEFAULT_IFS), &ifs_wide);
DEFAULT_IFS_SH : DEFAULT_IFS, &ifs_wide);
#endif
for (s = SPECCHARS; *s; s++)
typtab[STOUC(*s)] |= ISPECIAL;