Commit 0702d3d8 authored by Max Reitz's avatar Max Reitz Committed by Kevin Wolf
Browse files

blockdev: Add missing bdrv_unref() in drive-backup



All error paths after a successful bdrv_open() of target_bs should
contain a bdrv_unref(target_bs). This one did not yet, so add it.

Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarFam Zheng <famz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 01809194
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3171,6 +3171,7 @@ static void do_drive_backup(const char *device, const char *target,
        bmap = bdrv_find_dirty_bitmap(bs, bitmap);
        if (!bmap) {
            error_setg(errp, "Bitmap '%s' could not be found", bitmap);
            bdrv_unref(target_bs);
            goto out;
        }
    }