From b2f24ff0d2a9631f331c1841491ce60e69c20ca6 Mon Sep 17 00:00:00 2001 From: "Jun. T" Date: Tue, 6 Aug 2024 14:37:39 -0700 Subject: 53026: fix failure to free old value when setting new value of reference --- ChangeLog | 5 +++++ Src/params.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2fa2f51a3..667f17177 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-08-06 Bart Schaefer + + * Jun.T: 53026: Src/params.c: fix failure to free old value when + setting new value of reference + 2024-08-05 Bart Schaefer * 53025: Src/loop.c, Src/params.c: fix two memory leaks and two 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; -- cgit 1.4.1