aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2-cache.c')
-rw-r--r--block/qcow2-cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 84088477a4..340a6f2b26 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -49,9 +49,9 @@ Qcow2Cache *qcow2_cache_create(BlockDriverState *bs, int num_tables,
Qcow2Cache *c;
int i;
- c = qemu_mallocz(sizeof(*c));
+ c = g_malloc0(sizeof(*c));
c->size = num_tables;
- c->entries = qemu_mallocz(sizeof(*c->entries) * num_tables);
+ c->entries = g_malloc0(sizeof(*c->entries) * num_tables);
c->writethrough = writethrough;
for (i = 0; i < c->size; i++) {
@@ -70,8 +70,8 @@ int qcow2_cache_destroy(BlockDriverState* bs, Qcow2Cache *c)
qemu_vfree(c->entries[i].table);
}
- qemu_free(c->entries);
- qemu_free(c);
+ g_free(c->entries);
+ g_free(c);
return 0;
}