From 5135f137ea87973292585ae565044930c9d21709 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 15 Mar 2017 21:01:37 -0700 Subject: [PATCH] TAPE: Fix Coverity potential NULL pointer dereference --- sim_tape.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim_tape.c b/sim_tape.c index b2085fdd..48690196 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -527,13 +527,14 @@ return SCPE_OK; t_stat sim_tape_detach (UNIT *uptr) { struct tape_context *ctx; -uint32 f = MT_GET_FMT (uptr); +uint32 f; t_stat r; t_bool auto_format = FALSE; if (uptr == NULL) return SCPE_IERR; ctx = (struct tape_context *)uptr->tape_ctx; +f = MT_GET_FMT (uptr); if ((ctx == NULL) || !(uptr->flags & UNIT_ATT)) return SCPE_IERR;