aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/l2tpv3.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 3b805a7a4c..6014c43eff 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -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;