Revert "nl: fix memory leak"

This reverts commit 9d053394. This causes a double-free as the variable is already using __do_free. Closes #3452 Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 2410ff11
......@@ -106,10 +106,8 @@ struct nlmsg *nlmsg_alloc(size_t size)
return ret_set_errno(NULL, ENOMEM);
nlmsg->nlmsghdr = malloc(len);
if (!nlmsg->nlmsghdr) {
free(nlmsg);
if (!nlmsg->nlmsghdr)
return ret_set_errno(NULL, ENOMEM);
}
memset(nlmsg->nlmsghdr, 0, len);
nlmsg->cap = len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment