Fix heap-use-after-free when rewielding partial stack

This commit is contained in:
Pasi Kallinen
2019-12-29 17:28:15 +02:00
parent 4c82594193
commit 2dda1c43b2

View File

@@ -295,6 +295,8 @@ dowield()
any other item, we need to give it its own inventory slot */
if (uwep && uwep->o_id == g.context.objsplit.parent_oid) {
unsplitobj(wep);
/* wep was merged back to uwep, already_wielded uses wep */
wep = uwep;
goto already_wielded;
}
finish_splitting = TRUE;