static analyzer bit for pickup.c

src/pickup.c(3266): warning: Dereferencing NULL pointer 'otmp'.
This commit is contained in:
nhmall
2023-12-27 10:59:36 -05:00
parent 2f5fc70f02
commit 11c2586bdb

View File

@@ -3262,6 +3262,7 @@ menu_loot(int retry, boolean put_in)
n_looted = n;
for (i = 0; i < n; i++) {
otmp = pick_list[i].item.a_obj;
assert(otmp != 0);
count = pick_list[i].count;
if (count > 0 && count < otmp->quan) {
otmp = splitobj(otmp, count);