avoid mk_artifact()-related memory leaks

Reported directly to devteam after being discovered in nerfhack.
This commit is contained in:
nhmall
2025-01-26 11:57:01 -05:00
parent ed44da351e
commit 3cca4f2707
4 changed files with 48 additions and 22 deletions
+1
View File
@@ -1793,6 +1793,7 @@ bestow_artifact(uchar max_giftvalue)
if (do_bestow) {
struct obj *otmp;
/* mk_artifact() with NULL obj and a_align() arg can return NULL */
otmp = mk_artifact((struct obj *) 0, a_align(u.ux, u.uy),
max_giftvalue, TRUE);
if (otmp) {