1
0
mirror of https://github.com/simh/simh.git synced 2026-02-27 01:00:07 +00:00

TAPE: Fix Coverity potential NULL pointer dereference

This commit is contained in:
Mark Pizzolato
2017-03-15 21:01:37 -07:00
parent f0bee7f28e
commit 5135f137ea

View File

@@ -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;