diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index f543c78e6..a3ba2e1c8 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1146,6 +1146,7 @@ add '#tip' for containers to context-sensitive invent handling sequencing confusion: picking an item when viewing inventory and picking an action to do with it caused the inventory command to use time, then on next turn the action was performed without taking any time +program would access freed memory if charging caused a ring to explode curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/read.c b/src/read.c index 90fda12b0..b73c129cf 100644 --- a/src/read.c +++ b/src/read.c @@ -786,7 +786,7 @@ recharge(struct obj* obj, int curse_bless) if (is_on) Ring_gone(obj); s = rnd(3 * abs(obj->spe)); /* amount of damage */ - useup(obj); + useup(obj), obj = 0; losehp(Maybe_Half_Phys(s), "exploding ring", KILLED_BY_AN); } else { long mask = is_on ? (obj == uleft ? LEFT_RING : RIGHT_RING) : 0L;