From 9f746cfefa2563a523992002d955dd73150c0cbf Mon Sep 17 00:00:00 2001 From: Peter Schorn Date: Tue, 14 Mar 2017 18:12:27 +0100 Subject: [PATCH] AltairZ80: Improved diskClose error handling (Coverity Scan) --- AltairZ80/altairz80_hdsk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AltairZ80/altairz80_hdsk.c b/AltairZ80/altairz80_hdsk.c index 01ddcb1e..7ab9909f 100644 --- a/AltairZ80/altairz80_hdsk.c +++ b/AltairZ80/altairz80_hdsk.c @@ -528,7 +528,10 @@ static t_stat hdsk_detach(UNIT *uptr) { if (unitIndex == -1) return SCPE_IERR; assert((0 <= unitIndex) && (unitIndex < HDSK_NUMBER)); - diskClose(&hdsk_imd[unitIndex]); + result = diskClose(&hdsk_imd[unitIndex]); + if (result != SCPE_OK) { + return result; + } } result = detach_unit(uptr); uptr -> capac = HDSK_CAPACITY;