提交 eb863add 编写于 作者: K Kevin Wolf

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: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 6b837bc4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册