diff options
Diffstat (limited to 'block/qcow.c')
-rw-r--r-- | block/qcow.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow.c b/block/qcow.c index 67332f03c1..67c237fe7d 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -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; |