about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-03-18 12:23:31 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-03-18 12:23:31 +0000
commit2f8a646d4e68d3f515d0b5275d179562a219a9ed (patch)
tree0f7dd607386e8a2eb094f30fd3f764e2288cbf05 /Src/exec.c
parent91f0b666d00e58c50537d1ca48d90b1af8a25ae7 (diff)
downloadzsh-2f8a646d4e68d3f515d0b5275d179562a219a9ed.tar.gz
zsh-2f8a646d4e68d3f515d0b5275d179562a219a9ed.tar.xz
zsh-2f8a646d4e68d3f515d0b5275d179562a219a9ed.zip
19655, 19656, 19657: Memory leaks spotted by valgrind.
Also bug with multiple math function autoloads.
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 bb4194d52..4bd6503bf 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2519,6 +2519,10 @@ save_params(Estate state, Wordcode pc, LinkList *restore_p, LinkList *remove_p)
     while (wc_code(ac = *pc) == WC_ASSIGN) {
 	s = ecrawstr(state->prog, pc + 1, NULL);
 	if ((pm = (Param) paramtab->getnode(paramtab, s))) {
+	    if (pm->env) {
+		delenv(pm->env);
+		pm->env = NULL;
+	    }
 	    if (!(pm->flags & PM_SPECIAL)) {
 		paramtab->removenode(paramtab, s);
 	    } else if (!(pm->flags & PM_READONLY) &&