]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/qcow2-cluster.c
block: Use g_new() & friends where that makes obvious sense
[mirror_qemu.git] / block / qcow2-cluster.c
index 5b36018b3e0394c3d9803bb7fd92cbff2e01fc99..735f687b0680307bd9691cafd12c718a77ac5572 100644 (file)
@@ -711,7 +711,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m)
     trace_qcow2_cluster_link_l2(qemu_coroutine_self(), m->nb_clusters);
     assert(m->nb_clusters > 0);
 
-    old_cluster = g_try_malloc(m->nb_clusters * sizeof(uint64_t));
+    old_cluster = g_try_new(uint64_t, m->nb_clusters);
     if (old_cluster == NULL) {
         ret = -ENOMEM;
         goto err;