From a30c5ceba2afa9a49f4a3768330f8cb9649fb490 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 24 Dec 2023 00:40:20 -0500 Subject: [PATCH] static analyzer bit for makemon.c src/makemon.c(918): warning: Dereferencing NULL pointer '((mon))->mextra'. --- src/makemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/makemon.c b/src/makemon.c index f1ad1213a..22f32ac8c 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -914,8 +914,10 @@ clone_mon(struct monst *mon, However, tamedog() will not re-tame a tame dog, so m2 must be made non-tame to get initialized properly. */ m2->mtame = 0; - if (tamedog(m2, (struct obj *) 0)) + if (tamedog(m2, (struct obj *) 0)) { + assert(has_edog(m2)); *EDOG(m2) = *EDOG(mon); + } /* [TODO? some (most? all?) edog fields probably should be reinitialized rather that retain the 'parent's values] */ }