about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-11-02 12:04:46 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-11-02 12:04:46 +0000
commit337b9dba1fe271eda69e3437c8632f33433bd1e3 (patch)
treebfa763c7820605ec7354929e06e7c8e2190da921 /Src/params.c
parent6bca0ecb48e06d4a94d23ca6c700d5e7ff6e4261 (diff)
downloadzsh-337b9dba1fe271eda69e3437c8632f33433bd1e3.tar.gz
zsh-337b9dba1fe271eda69e3437c8632f33433bd1e3.tar.xz
zsh-337b9dba1fe271eda69e3437c8632f33433bd1e3.zip
21974: memory leak with tied parameters
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index 835c12230..1468c014a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2452,8 +2452,13 @@ stdunsetfn(Param pm, UNUSED(int exp))
 	    	pm->u.str = NULL;
 	    break;
     }
-    if (!(pm->flags & PM_SPECIAL))
+    if ((pm->flags & (PM_SPECIAL|PM_TIED)) == PM_TIED) {
+	if (pm->ename) {
+	    zsfree(pm->ename);
+	    pm->ename = NULL;
+	}
 	pm->flags &= ~PM_TIED;
+    }
     pm->flags |= PM_UNSET;
 }