From ef2d2d0f2b7401374bbf47eea5c8bc6542a0bfee Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 21 Sep 2008 12:54:57 +0000 Subject: 25701: fix memory leak in loadautofn. --- Src/exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Src') 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; } -- cgit 1.4.1