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 d9b8d95ec..af5a02f9c 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2913,6 +2913,7 @@ execautofn(Cmd cmd, LinkList args, int flags)
 
     if (l == &dummy_list) {
 	zerr("%s: function definition file not found", shf->nam, 0);
+	popheap();
 	return 1;
     }
     if (isset(KSHAUTOLOAD)) {
@@ -2922,6 +2923,7 @@ execautofn(Cmd cmd, LinkList args, int flags)
 	shf = (Shfunc) shfunctab->getnode(shfunctab, n);
 	if(!shf || (shf->flags & PM_UNDEFINED)) {
 	    zerr("%s: function not defined by file", n, 0);
+	    popheap();
 	    return 1;
 	}
     } else {