Intel-Systems: plug file descriptor leaks (Coverity Scan)

This commit is contained in:
Sergey Svishchev 2017-03-11 16:16:34 -08:00 committed by Mark Pizzolato
parent c6ed19aec3
commit 12bd47eb02
4 changed files with 4 additions and 0 deletions

View file

@ -388,6 +388,7 @@ t_stat isbc201_attach (UNIT *uptr, CONST char *cptr)
fdc201[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen); fdc201[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen);
if (fdc201[fdcnum].fdd[fddnum].buf == NULL) { if (fdc201[fdcnum].fdd[fddnum].buf == NULL) {
sim_printf(" isbc201_attach: Malloc error\n"); sim_printf(" isbc201_attach: Malloc error\n");
free(fp);
return SCPE_MEM; return SCPE_MEM;
} }
} }

View file

@ -401,6 +401,7 @@ t_stat isbc202_attach (UNIT *uptr, CONST char *cptr)
fdc202[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen); fdc202[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen);
if (fdc202[fdcnum].fdd[fddnum].buf == NULL) { if (fdc202[fdcnum].fdd[fddnum].buf == NULL) {
sim_printf(" isbc202_attach: Malloc error\n"); sim_printf(" isbc202_attach: Malloc error\n");
free(fp);
return SCPE_MEM; return SCPE_MEM;
} }
} }

View file

@ -1073,6 +1073,7 @@ t_stat isbc208_attach (UNIT *uptr, CONST char *cptr)
isbc208_buf[uptr->u6] = (uint8 *)malloc(flen); isbc208_buf[uptr->u6] = (uint8 *)malloc(flen);
if (isbc208_buf[uptr->u6] == NULL) { if (isbc208_buf[uptr->u6] == NULL) {
sim_printf(" iSBC208_attach: Malloc error\n"); sim_printf(" iSBC208_attach: Malloc error\n");
free(fp);
return SCPE_MEM; return SCPE_MEM;
} }
} }

View file

@ -405,6 +405,7 @@ t_stat zx200a_attach (UNIT *uptr, CONST char *cptr)
zx200a[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen); zx200a[fdcnum].fdd[fddnum].buf = (uint8 *)malloc(flen);
if (zx200a[fdcnum].fdd[fddnum].buf == NULL) { if (zx200a[fdcnum].fdd[fddnum].buf == NULL) {
sim_printf(" zx200a_attach: Malloc error\n"); sim_printf(" zx200a_attach: Malloc error\n");
free(fp);
return SCPE_MEM; return SCPE_MEM;
} }
} }