提交 e8d3eb74 编写于 作者: M Marc-André Lureau 提交者: Eric Blake

NBD: use g_new() family of functions

Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20171006235023.11952-22-f4bug@amsat.org>
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 f90ea7ba
......@@ -1047,7 +1047,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, off_t size,
{
AioContext *ctx;
BlockBackend *blk;
NBDExport *exp = g_malloc0(sizeof(NBDExport));
NBDExport *exp = g_new0(NBDExport, 1);
uint64_t perm;
int ret;
......@@ -1539,7 +1539,7 @@ void nbd_client_new(NBDExport *exp,
NBDClient *client;
Coroutine *co;
client = g_malloc0(sizeof(NBDClient));
client = g_new0(NBDClient, 1);
client->refcount = 1;
client->exp = exp;
client->tlscreds = tlscreds;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册