Commit a8c5cf27 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

file-posix: Fix leaked fd in raw_open_common() error path



Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Message-Id: <20200717105426.51134-4-kwolf@redhat.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent bca5283b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -773,6 +773,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
    }
    ret = 0;
fail:
    if (ret < 0 && s->fd != -1) {
        qemu_close(s->fd);
    }
    if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) {
        unlink(filename);
    }