diff options
Diffstat (limited to 'block/rbd.c')
-rw-r--r-- | block/rbd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/rbd.c b/block/rbd.c index 4459102adf..3aaf8559dd 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -652,7 +652,7 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, off = sector_num * BDRV_SECTOR_SIZE; size = nb_sectors * BDRV_SECTOR_SIZE; - rcb = g_malloc(sizeof(RADOSCB)); + rcb = g_new(RADOSCB, 1); rcb->done = 0; rcb->acb = acb; rcb->buf = buf; @@ -873,7 +873,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, goto done; } - sn_tab = g_malloc0(snap_count * sizeof(QEMUSnapshotInfo)); + sn_tab = g_new0(QEMUSnapshotInfo, snap_count); for (i = 0; i < snap_count; i++) { const char *snap_name = snaps[i].name; |