about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorJun. T <takimoto-j@kba.biglobe.ne.jp>2024-08-06 14:37:39 -0700
committerBart Schaefer <schaefer@zsh.org>2024-08-06 14:37:39 -0700
commitb2f24ff0d2a9631f331c1841491ce60e69c20ca6 (patch)
tree4969d858ccb3dec625c9de45e5fedf0f8ab07e98 /Src
parent72751bfe1f9e37145c12e244ebb1729c27aff901 (diff)
downloadzsh-b2f24ff0d2a9631f331c1841491ce60e69c20ca6.tar.gz
zsh-b2f24ff0d2a9631f331c1841491ce60e69c20ca6.tar.xz
zsh-b2f24ff0d2a9631f331c1841491ce60e69c20ca6.zip
53026: fix failure to free old value when setting new value of reference
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index f143a790f..acd577527 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -482,7 +482,8 @@ static initparam argvparam_pm = IPDEF9("", &pparams, NULL, \
 #define GETREFNAME(PM) (((PM)->node.flags & PM_SPECIAL) ?	\
 			(PM)->gsu.s->getfn(PM) : (PM)->u.str)
 #define SETREFNAME(PM,S) (((PM)->node.flags & PM_SPECIAL) ?		\
-			  (PM)->gsu.s->setfn(PM,(S)) : ((PM)->u.str = (S)))
+			  (PM)->gsu.s->setfn(PM,(S)) :			\
+			  (zsfree((PM)->u.str), (PM)->u.str = (S)))
 
 static Param argvparam;