aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block.c b/block.c
index 01b66d8..d5ce8d3 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);
}