Skip to content

Commit

Permalink
net: Fuse g_malloc(); memset() into g_new0()
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Markus Armbruster authored and stefanhaRH committed Dec 19, 2014
1 parent 23120b1 commit 71e28e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/l2tpv3.c
Expand Up @@ -695,8 +695,7 @@ int net_init_l2tpv3(const NetClientOptions *opts,
goto outerr;
}

s->dgram_dst = g_malloc(sizeof(struct sockaddr_storage));
memset(s->dgram_dst, '\0' , sizeof(struct sockaddr_storage));
s->dgram_dst = g_new0(struct sockaddr_storage, 1);
memcpy(s->dgram_dst, result->ai_addr, result->ai_addrlen);
s->dst_size = result->ai_addrlen;

Expand Down

0 comments on commit 71e28e3

Please sign in to comment.