[PATCH] inet: Fix resource leak

Danny Jeongseok Seo s.seo at samsung.com
Thu Nov 8 21:46:27 PST 2012


The socket was not closed when err < 0 is true.
---
 src/inet.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/inet.c b/src/inet.c
index be69aca..7a0bc7e 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -1382,9 +1382,7 @@ int connman_inet_setup_tunnel(char *tunnel, int mtu)
 	index = if_nametoindex(tunnel);
 
 	err = connman_inet_set_mtu(index, mtu);
-	if (err < 0)
-		return err;
-	else if (err)
+	if (err != 0)
 		goto done;
 
 	memset(&ifr, 0, sizeof(ifr));
-- 
1.7.10.4




More information about the connman mailing list