Clear tin-eating struct when object goes away
The tin-eating context was pointing to a non-existent object, causing an error when the fuzzer somehow managed to continue eating the freed tin object. Clear the pointer when the tin leaves inventory or the object is deleted.
This commit is contained in:
@@ -1373,6 +1373,11 @@ freeinv_core(struct obj *obj)
|
||||
} else if (obj->otyp == FIGURINE && obj->timed) {
|
||||
(void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
|
||||
}
|
||||
|
||||
if (obj == svc.context.tin.tin) {
|
||||
svc.context.tin.tin = (struct obj *) 0;
|
||||
svc.context.tin.o_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* remove an object from the hero's inventory */
|
||||
|
||||
Reference in New Issue
Block a user