diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-04-29 11:39:34 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-04-29 11:39:34 +0200 |
commit | 741f912bc2b8da74ce7d60325dff662bdb4b2bfe (patch) | |
tree | 2d5d98f636d86a7d30033d67f5585ca21b7b1ab0 /iface.c | |
parent | c7f21bebbeadf36f71251b6b0c62f2d93b308a5c (diff) |
iface: Close rtnl socket if address enumeration fails
Fix a resource leak by closing the socket if iface_rtnl_enumerate()
fails.
Discovered by the Coverity scanner CID 99694.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'iface.c')
-rw-r--r-- | iface.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -355,9 +355,9 @@ int iface_run(void) /* send RTM_GETADDR request to initially populate the interface list */ if (iface_rtnl_enumerate(sock, RTM_GETADDR, AF_INET) < 0) - return -1; + goto out; if (iface_rtnl_enumerate(sock, RTM_GETADDR, AF_INET6) < 0) - return -1; + goto out; while (iface_running) { ssize_t recvlen; |