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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index e74fac578..85d996bd4 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4159,6 +4159,10 @@ execfuncdef(Estate state, UNUSED(int do_exec))
 
 	    execshfunc(shf, args);
 	    ret = lastval;
+
+	    freeeprog(shf->funcdef);
+	    zsfree(shf->filename);
+	    zfree(shf, sizeof(*shf));
 	    break;
 	} else {
 	    /* is this shell function a signal trap? */