diff options
Diffstat (limited to 'block/sheepdog.c')
| -rw-r--r-- | block/sheepdog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 8d9350c26d..12cbd9dcb4 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1682,7 +1682,7 @@ static int sd_create(const char *filename, QemuOpts *opts, uint32_t snapid; bool prealloc = false; - s = g_malloc0(sizeof(BDRVSheepdogState)); + s = g_new0(BDRVSheepdogState, 1); memset(tag, 0, sizeof(tag)); if (strstr(filename, "://")) { @@ -2273,7 +2273,7 @@ static int sd_snapshot_goto(BlockDriverState *bs, const char *snapshot_id) uint32_t snapid = 0; int ret = 0; - old_s = g_malloc(sizeof(BDRVSheepdogState)); + old_s = g_new(BDRVSheepdogState, 1); memcpy(old_s, s, sizeof(BDRVSheepdogState)); @@ -2357,7 +2357,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) goto out; } - sn_tab = g_malloc0(nr * sizeof(*sn_tab)); + sn_tab = g_new0(QEMUSnapshotInfo, nr); /* calculate a vdi id with hash function */ hval = fnv_64a_buf(s->name, strlen(s->name), FNV1A_64_INIT); |