From 6528499fa4c3ceaec01ad29d8090ef55918ebfb3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 22 Jan 2013 11:07:56 +0100 Subject: g_malloc(0) and g_malloc0(0) return NULL; simplify Once upon a time, it was decided that qemu_malloc(0) should abort. Switching to glib retired that bright idea. Some code that was added to cope with it (e.g. in commits 702ef63, b76b6e9) is still around. Bury it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- block/vdi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'block/vdi.c') diff --git a/block/vdi.c b/block/vdi.c index 257a592ea9..87c691b504 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -443,9 +443,7 @@ static int vdi_open(BlockDriverState *bs, int flags) bmap_size = header.blocks_in_image * sizeof(uint32_t); bmap_size = (bmap_size + SECTOR_SIZE - 1) / SECTOR_SIZE; - if (bmap_size > 0) { - s->bmap = g_malloc(bmap_size * SECTOR_SIZE); - } + s->bmap = g_malloc(bmap_size * SECTOR_SIZE); ret = bdrv_read(bs->file, s->bmap_sector, (uint8_t *)s->bmap, bmap_size); if (ret < 0) { goto fail_free_bmap; -- cgit v1.2.3