fix memory leak: obj->oextra->omonst->mextra
commit95772261dcbd8d30dba0ead204d5955a541e0b66
authorPatR <rankin@nethack.org>
Sat, 14 Nov 2015 04:39:10 +0000 (13 20:39 -0800)
committerPatR <rankin@nethack.org>
Sat, 14 Nov 2015 04:39:10 +0000 (13 20:39 -0800)
tree763373f7f2b3e74a25c93fc16e405adca87cc0cc
parent24099c50b287831c8d782b52d766c96797bd9142
fix memory leak: obj->oextra->omonst->mextra

The memory leak (monst->mextra->edog, monst->mextra->mname,
monst->mextra for some monster were not released) I noticed recently
was due to recording a pet's full monster attributes with its corpse.
During save and restore, obj->oextra->omonst was being treated as a
full-fledged monster so worked as intended, but when freed, omonst
was treated as a black box and its mextra details weren't handled.
include/extern.h
src/mkobj.c
src/mon.c
src/zap.c