]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Prevent double-free.
authorToni Wilen <twilen@winuae.net>
Sun, 14 Feb 2016 16:36:04 +0000 (18:36 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 14 Feb 2016 16:36:04 +0000 (18:36 +0200)
hardfile.cpp

index a8a07ce5e25024635f4bccb66e13a20b7d2b1af4..d87d3b3604356f4c23f4729b2acc1b75934e5235 100644 (file)
@@ -2074,6 +2074,7 @@ static uae_u32 REGPARAM2 hardfile_close (TrapContext *ctx)
        if (!hfpd)
                return 0;
        scsi_free(hfpd->sd);
+       hfpd->sd = NULL;
        trap_put_word(ctx, hfpd->base + 32, trap_get_word(ctx, hfpd->base + 32) - 1);
        if (trap_get_word(ctx, hfpd->base + 32) == 0) {
                write_comm_pipe_pvoid(&hfpd->requests, NULL, 0);