diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | Src/exec.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 874a4e3aa..96fc3a619 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-09-21 Clint Adams <clint@zsh.org> + * 25701: Src/exec.c: fix memory leak in loadautofn. + * 25697: Functions/Prompts/prompt_clint_setup: drop git code and switch to vcs_info. diff --git a/Src/exec.c b/Src/exec.c index 781598cc1..55b058c17 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4134,10 +4134,13 @@ loadautofn(Shfunc shf, int fksh, int autol) zwarn("%s: function definition file not found", shf->node.nam); locallevel++; popheap(); + zsfree(fname); return NULL; } - if (!prog) + if (!prog) { + zsfree(fname); return NULL; + } if (ksh == 2 || (ksh == 1 && isset(KSHAUTOLOAD))) { if (autol) { prog->flags |= EF_RUN; @@ -4174,6 +4177,7 @@ loadautofn(Shfunc shf, int fksh, int autol) shf->filename = fname; } popheap(); + zsfree(fname); return shf; } |