static analyzer bits for restore.c

src/restore.c(275): warning: Dereferencing NULL pointer. 'otmp' contains the
                             same NULL value as 'first' did.
src/restore.c(402): warning: Dereferencing NULL pointer. 'mtmp' contains the
                             same NULL value as 'first' did.
This commit is contained in:
nhmall
2023-12-27 11:03:25 -05:00
parent e9ced6e2f9
commit 6e654cb9a5

View File

@@ -250,6 +250,7 @@ restobjchn(NHFILE *nhfp, boolean frozen)
break;
otmp = newobj();
assert(otmp != 0);
restobj(nhfp, otmp);
if (!first)
first = otmp;
@@ -387,6 +388,7 @@ restmonchn(NHFILE *nhfp)
break;
mtmp = newmonst();
assert(mtmp != 0);
restmon(nhfp, mtmp);
if (!first)
first = mtmp;