mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-12 15:38:21 +00: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
@ -1411,9 +1411,13 @@ out:
|
||||
qemu_progress_end();
|
||||
/* Cleanup */
|
||||
if (!unsafe) {
|
||||
if (bs_old_backing != NULL) {
|
||||
bdrv_delete(bs_old_backing);
|
||||
}
|
||||
if (bs_new_backing != NULL) {
|
||||
bdrv_delete(bs_new_backing);
|
||||
}
|
||||
}
|
||||
|
||||
bdrv_delete(bs);
|
||||
if (ret) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user