summaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorDanny Jeongseok Seo <s.seo@samsung.com>2012-11-09 05:46:27 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-13 12:36:24 (GMT)
commitc439bb03072c39ebecf38b08c5925757ab36c36d (patch)
treeedebd2b8f67667c051e5b9b61f836bfcc68d3ea5 /src/inet.c
parent7ed8eb9c3de85b23cfcb6b3e4cc9616cd4d29830 (diff)
downloadconnman-c439bb03072c39ebecf38b08c5925757ab36c36d.zip
connman-c439bb03072c39ebecf38b08c5925757ab36c36d.tar.gz
connman-c439bb03072c39ebecf38b08c5925757ab36c36d.tar.bz2
inet: Fix resource leak
The socket was not closed when err < 0 is true.
Diffstat (limited to 'src/inet.c')
-rw-r--r--src/inet.c4
1 files changed, 1 insertions, 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));