53023: fix memory leak of unset private parameter

This commit is contained in:
Bart Schaefer 2024-08-05 15:49:15 -07:00
parent 4616ea398a
commit 65da467441
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2024-08-05 Bart Schaefer <schaefer@zsh.org>
* 53023: Src/params.c: fix memory leak of unset private parameter
2024-08-04 Bart Schaefer <schaefer@zsh.org>
* Philippe Altherr: 53005: Src/exec.c: off-by-one error when

View file

@ -3790,7 +3790,7 @@ unsetparam_pm(Param pm, int altflag, int exp)
altremove = NULL;
pm->node.flags &= ~PM_DECLARED; /* like ksh, not like bash */
if (!(pm->node.flags & PM_UNSET))
if (!(pm->node.flags & PM_UNSET) || (pm->node.flags & PM_REMOVABLE))
pm->gsu.s->unsetfn(pm, exp);
if (pm->env)
delenv(pm);