about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-12-05 16:59:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-12-05 16:59:41 +0000
commit9371146ad7a4c2f52c0dc50bccbd67b7781ed5c7 (patch)
treefafa9daca5b5ab5dc2280f57c9be8dc8194bd8e4 /Src
parentddee5deb2dda383d597af69971cb8d85e3dc1598 (diff)
downloadzsh-9371146ad7a4c2f52c0dc50bccbd67b7781ed5c7.tar.gz
zsh-9371146ad7a4c2f52c0dc50bccbd67b7781ed5c7.tar.xz
zsh-9371146ad7a4c2f52c0dc50bccbd67b7781ed5c7.zip
28469: fix memory leak in anonymous function
Diffstat (limited to 'Src')
-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? */