diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2015-01-05 16:46:26 +0100 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2015-01-06 23:50:37 +0100 |
commit | bd2175fe7dad87575ae838fa116226aff4c18191 (patch) | |
tree | 98d60557d848e8e2bdfca458b04cd76631a2c707 /Src | |
parent | 1507719d0a5c8ff8694583fbc4c993e937fb9266 (diff) | |
download | zsh-bd2175fe7dad87575ae838fa116226aff4c18191.tar.gz zsh-bd2175fe7dad87575ae838fa116226aff4c18191.tar.xz zsh-bd2175fe7dad87575ae838fa116226aff4c18191.zip |
34134: anon funcs: don't leak shf and related data
Found by Coverity (Issue 439076).
Diffstat (limited to 'Src')
-rw-r--r-- | Src/exec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c index 6b93008bd..ab9291024 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4461,6 +4461,11 @@ execfuncdef(Estate state, Eprog redir_prog) if (htok && args) { execsubst(args); if (errflag) { + freeeprog(shf->funcdef); + if (shf->redir) /* shouldn't be */ + freeeprog(shf->redir); + zsfree(shf->filename); + zfree(shf, sizeof(*shf)); state->pc = end; return 1; } @@ -4486,6 +4491,7 @@ execfuncdef(Estate state, Eprog redir_prog) (signum = getsignum(s + 4)) != -1) { if (settrap(signum, NULL, ZSIG_FUNC)) { freeeprog(shf->funcdef); + zsfree(shf->filename); zfree(shf, sizeof(*shf)); state->pc = end; return 1; |