Commit 9562f69c authored by Max Reitz's avatar Max Reitz Committed by Stefan Hajnoczi
Browse files

block: Unlink temporary file



If the image file cannot be opened and was created as a temporary file,
it should be deleted; thus, in this case, we should jump to the
"unlink_and_fail" label and not just to "fail".

Reported-by: default avatarBenoît Canet <benoit@irqsave.net>
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 27eb6c09
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ int bdrv_open(BlockDriverState **pbs, const char *filename,
                          bdrv_open_flags(bs, flags | BDRV_O_UNMAP) |
                          BDRV_O_PROTOCOL, true, &local_err);
    if (ret < 0) {
        goto fail;
        goto unlink_and_fail;
    }

    /* Find the right image format driver */