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

34107: getsubsargs: free ptr1 before returning

Found by Coverity (Issue 439073).
This commit is contained in:
Mikael Magnusson 2015-01-06 00:40:23 +01:00
parent bd2175fe7d
commit 6a5339fdd5
2 changed files with 3 additions and 0 deletions

View file

@ -1,5 +1,7 @@
2015-01-06 Mikael Magnusson <mikachu@gmail.com>
* 34107: Src/hist.c: getsubsargs: free ptr1 before returning
* 34134: Src/exec.c: anon funcs: don't leak shf and related data
* 34112: Src/builtin.c: typeset: fix leak of oldval

View file

@ -367,6 +367,7 @@ getsubsargs(char *subline, int *gbalp, int *cflagp)
zsfree(hsubl);
hsubl = ptr1;
} else if (!hsubl) { /* fail silently on this */
zsfree(ptr1);
zsfree(ptr2);
return 0;
}