about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index a41d05b41..7bec7ce48 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5204,6 +5204,7 @@ loadautofn(Shfunc shf, int fksh, int autol, int current_fpath)
 	    else
 		shf->funcdef = dupeprog(prog, 0);
 	    shf->node.flags &= ~PM_UNDEFINED;
+	    zsfree(shf->filename);
 	    shf->filename = fname;
 	} else {
 	    VARARR(char, n, strlen(shf->node.nam) + 1);
@@ -5227,6 +5228,7 @@ loadautofn(Shfunc shf, int fksh, int autol, int current_fpath)
 	else
 	    shf->funcdef = dupeprog(stripkshdef(prog, shf->node.nam), 0);
 	shf->node.flags &= ~PM_UNDEFINED;
+	zsfree(shf->filename);
 	shf->filename = fname;
     }
     popheap();