aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block.c b/block.c
index 01b66d802a..d5ce8d39e4 100644
--- a/block.c
+++ b/block.c
@@ -1606,11 +1606,11 @@ void bdrv_delete(BlockDriverState *bs)
assert(!bs->job);
assert(!bs->in_use);
+ bdrv_close(bs);
+
/* remove from list, if necessary */
bdrv_make_anon(bs);
- bdrv_close(bs);
-
g_free(bs);
}