eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 39bb4d07ee51d3b8b2c40710b42b8042c9c19524
parent 34560120f9ddca5a13d761d90e5b01e232bf7fb4
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Thu, 17 Oct 2019 11:28:11 -0500

monitor: Fix potential memory leak

In case l_netlink object was not created successfully, rtmmsg would
leak.

Diffstat:
Mmonitor/main.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/monitor/main.c b/monitor/main.c @@ -221,6 +221,12 @@ static struct l_netlink *rtm_interface_send_message(struct l_netlink *rtnl, return NULL; } + if (!rtnl) + rtnl = l_netlink_new(NETLINK_ROUTE); + + if (!rtnl) + return NULL; + bufsize = NLMSG_LENGTH(sizeof(struct ifinfomsg)) + RTA_SPACE(ifname_len) + RTA_SPACE(0) + RTA_SPACE(nlmon_type_len); @@ -231,12 +237,6 @@ static struct l_netlink *rtm_interface_send_message(struct l_netlink *rtnl, rtmmsg->ifi_family = AF_UNSPEC; rtmmsg->ifi_change = ~0; - if (!rtnl) - rtnl = l_netlink_new(NETLINK_ROUTE); - - if (!rtnl) - return NULL; - rta_buf = rtmmsg + 1; if (ifname)