summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
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;
 }