permapoisoned follow-up

otmp can be 0 in mk_artifact. In fact, it is explicitly
being set to 0 three lines above the recently added call
to permapoisoned().

The static analyzer was griping also.
This commit is contained in:
nhmall
2025-06-01 22:31:09 -04:00
parent 2414e56646
commit 8d5ffbd6e3
+1 -1
View File
@@ -301,7 +301,7 @@ mk_artifact(
otmp = 0; otmp = 0;
} /* otherwise, otmp has not changed; just fallthrough to return it */ } /* otherwise, otmp has not changed; just fallthrough to return it */
} }
if (permapoisoned(otmp)) if (otmp && permapoisoned(otmp))
otmp->opoisoned = 1; otmp->opoisoned = 1;
return otmp; return otmp;
} }