Something I noticed while looking over the recent report about hug
attacks. If a monster carrying one or more boulders (picked up while
in giant form) polymorphs into a non-giant, it will drop them. If
that happens while it's trapped, it could be killed. newcham() would
use a stale pointer to continue traversing its inventory after it was
dead and its possessions had been dropped.
I managed to get a chameleon-as-giant carrying boulders and some other
stuff trapped in a bear trap and then transform, but the few attempts
I made never killed off its next form so I wasn't able to induce a
crash to verify that a problem would actually occur.