Fixed possible NULL pointer dereference. (from Sergey Oboguev)
This commit is contained in:
parent
c6c9e0c3ac
commit
190993b5f4
1 changed files with 2 additions and 1 deletions
|
@ -1025,13 +1025,14 @@ return SCPE_OK;
|
||||||
|
|
||||||
t_stat sim_disk_detach (UNIT *uptr)
|
t_stat sim_disk_detach (UNIT *uptr)
|
||||||
{
|
{
|
||||||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
struct disk_context *ctx;
|
||||||
int (*close_function)(FILE *f);
|
int (*close_function)(FILE *f);
|
||||||
FILE *fileref;
|
FILE *fileref;
|
||||||
t_bool auto_format;
|
t_bool auto_format;
|
||||||
|
|
||||||
if (uptr == NULL)
|
if (uptr == NULL)
|
||||||
return SCPE_IERR;
|
return SCPE_IERR;
|
||||||
|
ctx = (struct disk_context *)uptr->disk_ctx;
|
||||||
fileref = uptr->fileref;
|
fileref = uptr->fileref;
|
||||||
switch (DK_GET_FMT (uptr)) { /* case on format */
|
switch (DK_GET_FMT (uptr)) { /* case on format */
|
||||||
case DKUF_F_STD: /* Simh */
|
case DKUF_F_STD: /* Simh */
|
||||||
|
|
Loading…
Add table
Reference in a new issue