mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-11 19:39:26 -07:00
qemu-img rebase: Fix segfault if backing file can't be opened
bdrv_delete must not be called for a NULL BlockDriverState. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
parent
6b837bc4a4
commit
eb863add02
1 changed files with 6 additions and 2 deletions
|
|
@ -1411,8 +1411,12 @@ out:
|
|||
qemu_progress_end();
|
||||
/* Cleanup */
|
||||
if (!unsafe) {
|
||||
bdrv_delete(bs_old_backing);
|
||||
bdrv_delete(bs_new_backing);
|
||||
if (bs_old_backing != NULL) {
|
||||
bdrv_delete(bs_old_backing);
|
||||
}
|
||||
if (bs_new_backing != NULL) {
|
||||
bdrv_delete(bs_new_backing);
|
||||
}
|
||||
}
|
||||
|
||||
bdrv_delete(bs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue