OSDN Git Service

block/cloop: Use g_free instead of free
authorDong Xu Wang <wdongxu@linux.vnet.ibm.com>
Wed, 2 Nov 2011 08:36:21 +0000 (16:36 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Nov 2011 13:24:12 +0000 (14:24 +0100)
Fix mismatching allocation and deallocation: g_free should be used to pair with
g_malloc.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed_by: Ray Wang <raywang@linux.vnet.ibm.com>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/cloop.c

index 799b6c2..7570eb8 100644 (file)
@@ -171,10 +171,10 @@ static void cloop_close(BlockDriverState *bs)
 {
     BDRVCloopState *s = bs->opaque;
     if (s->n_blocks > 0) {
-        free(s->offsets);
+        g_free(s->offsets);
     }
-    free(s->compressed_block);
-    free(s->uncompressed_block);
+    g_free(s->compressed_block);
+    g_free(s->uncompressed_block);
     inflateEnd(&s->zstream);
 }