Fix block-vmdk.c:vmdk_close() use-after-free, by Ed Maste.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 22 May 2008 13:51:48 +0000 (13:51 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 22 May 2008 13:51:48 +0000 (13:51 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4526 c046a42c-6fe2-441c-8c8c-71466251a162

block-vmdk.c

index 9b5fb7346a9f932cddfd194c15032ffb47a02063..843bf869d0a0c759c21df36536226dc23a3cf8fc 100644 (file)
@@ -808,9 +808,9 @@ static void vmdk_close(BlockDriverState *bs)
 
     qemu_free(s->l1_table);
     qemu_free(s->l2_cache);
-    bdrv_delete(s->hd);
     // try to close parent image, if exist
     vmdk_parent_close(s->hd);
+    bdrv_delete(s->hd);
 }
 
 static void vmdk_flush(BlockDriverState *bs)