mirror of https://gitee.com/openkylin/qemu.git
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
|
@ -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…
Reference in New Issue