]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Remove extra memset from __nlmsg_alloc
authorOlaf Hering <olaf@aepfle.de>
Fri, 8 Nov 2013 16:15:16 +0000 (17:15 +0100)
committerOlaf Hering <olaf@aepfle.de>
Fri, 8 Nov 2013 16:15:16 +0000 (17:15 +0100)
A few lines above nm->nm_nlh is already allocated with calloc, the
allocated memory has at least sizeof(struct nlmsghdr).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
lib/msg.c

index 3c58cb7cdde0c49f97655aa23878697e976f84b2..87ebe48a990e6354a249afb24641f39a2768664f 100644 (file)
--- a/lib/msg.c
+++ b/lib/msg.c
@@ -275,8 +275,6 @@ static struct nl_msg *__nlmsg_alloc(size_t len)
        if (!nm->nm_nlh)
                goto errout;
 
-       memset(nm->nm_nlh, 0, sizeof(struct nlmsghdr));
-
        nm->nm_protocol = -1;
        nm->nm_size = len;
        nm->nm_nlh->nlmsg_len = nlmsg_total_size(0);