1
0
Fork 0
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:
Martijn Dekker 2021-01-17 03:55:46 +00:00
parent 9a48ba1557
commit e25d9f4190

View file

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