Skip to content

Commit

Permalink
NBD: use g_new() family of functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco authored and ebblake committed Oct 12, 2017
1 parent f90ea7b commit e8d3eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nbd/server.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e8d3eb7

Please sign in to comment.