NBD: use g_new() family of functions
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 6 Oct 2017 23:49:16 +0000 (20:49 -0300)
committerEric Blake <eblake@redhat.com>
Thu, 12 Oct 2017 20:56:06 +0000 (15:56 -0500)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20171006235023.11952-22-f4bug@amsat.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
nbd/server.c

index 993ade30bb922690c132a476d05d6172e66456e9..b74cc6ab7e9d9fde94903eaea8c9128d34a08c46 100644 (file)
@@ -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;