mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
nv_newattr(): fix potential invalid free
src/cmd/ksh93/sh/name.c: - Zero the 'cp' pointer after freeing it, as the next loop iteration may otherwise re-use the old address.
This commit is contained in:
parent
9a48ba1557
commit
e25d9f4190
1 changed files with 1 additions and 0 deletions
|
@ -3032,6 +3032,7 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
|
|||
if(!mp)
|
||||
nv_putval (np, cp, NV_RDONLY);
|
||||
free(cp);
|
||||
cp = 0;
|
||||
}
|
||||
}
|
||||
while(ap && nv_nextsub(np));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue