From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 3/5] net: Fuse g_malloc(); memset() into g_new0()
Date: Fri, 19 Dec 2014 13:18:22 +0000 [thread overview]
Message-ID: <1418995104-26262-4-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1418995104-26262-1-git-send-email-stefanha@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
net/l2tpv3.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 3b805a7..6014c43 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;
--
2.1.0
next prev parent reply other threads:[~2014-12-19 13:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-19 13:18 [Qemu-devel] [PULL 0/5] Net patches Stefan Hajnoczi
2014-12-19 13:18 ` [Qemu-devel] [PULL 1/5] tap: fix vcpu long time io blocking on tap Stefan Hajnoczi
2014-12-19 13:18 ` [Qemu-devel] [PULL 2/5] net: don't use set/get_pointer() in set/get_netdev() Stefan Hajnoczi
2014-12-19 13:18 ` Stefan Hajnoczi [this message]
2014-12-19 13:18 ` [Qemu-devel] [PULL 4/5] net: Use g_new() & friends where that makes obvious sense Stefan Hajnoczi
2014-12-19 13:18 ` [Qemu-devel] [PULL 5/5] e1000: defer packets until BM enabled Stefan Hajnoczi
2014-12-19 14:21 ` Michael S. Tsirkin
2014-12-21 23:16 ` [Qemu-devel] [PULL 0/5] Net patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418995104-26262-4-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).