1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix leak in optimize processing

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.
This commit is contained in:
Martijn Dekker 2021-01-27 05:45:51 +00:00
parent 6d1352699e
commit 9b5ff0f833

View file

@ -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