From 6e654cb9a50f7157126bae02114f823dacdb0d8d Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 27 Dec 2023 11:03:25 -0500 Subject: [PATCH] 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. --- src/restore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/restore.c b/src/restore.c index 109f1770e..a7883a0a1 100644 --- a/src/restore.c +++ b/src/restore.c @@ -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;