Skip to content

Commit

Permalink
Fix leak in optimize processing
Browse files Browse the repository at this point in the history
This applies a patch from OpenSUSE. Source:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-optimizeleak.dif

| Tue Jul  5 14:49:03 CEST 2016 - mls@suse.de
|
| - fix leak in optimize processing [bnc#982423]
|   new patch: ksh93-optimizeleak.dif

Unfortunately the bug report is not currently public:
https://bugzilla.opensuse.org/show_bug.cgi?id=982423
but this one seems sensible enough and is in production use,
so I'll take it on faith.
  • Loading branch information
McDutchie committed Jan 27, 2021
1 parent 6d13526 commit 9b5ff0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cmd/ksh93/sh/name.c
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,13 @@ void nv_optimize(Namval_t *np)
}
if((xp= (struct optimize*)fp) && xp->ptr==shp->argaddr)
return;
if(xp && xp->next)
{
register struct optimize *xpn;
for(xpn = xp->next; xpn; xpn = xpn->next)
if(xpn->ptr == shp->argaddr && xpn->np == np)
return;
}
if(op = opt_free)
opt_free = op->next;
else
Expand Down

0 comments on commit 9b5ff0f

Please sign in to comment.