]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/qcow.c
block: Use g_new() & friends where that makes obvious sense
[mirror_qemu.git] / block / qcow.c
index 67332f03c18752c7c85b094804740aa4a0352cda..67c237fe7d034afd3a3038694caac6d209520fa3 100644 (file)
@@ -182,7 +182,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     s->l1_table_offset = header.l1_table_offset;
-    s->l1_table = g_try_malloc(s->l1_size * sizeof(uint64_t));
+    s->l1_table = g_try_new(uint64_t, s->l1_size);
     if (s->l1_table == NULL) {
         error_setg(errp, "Could not allocate memory for L1 table");
         ret = -ENOMEM;