Diff between c773fd53c9539eea59c1a037c4fa7db59e1ac115 and bb14a8b18f9462aade345cb0529957b152b75db9

Changed Files

File Additions Deletions Status
tools/l2cap-tester.c +1 -0 modified
tools/tester.h +1 -0 modified

Full Patch

diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index c473c6c..2087725 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -1954,6 +1954,7 @@ static int connect_socket(const uint8_t *client_bdaddr, GIOFunc connect_cb,
 			tester_print("Can't enable deferred setup: %s (%d)",
 						strerror(errno), errno);
 			tester_test_failed();
+			close(sk);
 			return -1;
 		}
 	}
diff --git a/tools/tester.h b/tools/tester.h
index 8964751..9df600f 100644
--- a/tools/tester.h
+++ b/tools/tester.h
@@ -334,6 +334,7 @@ static inline void test_ethtool_get_ts_info(unsigned int index, int proto,
 	if (ioctl(sk, SIOCETHTOOL, &ifr) == -1) {
 		tester_warn("SIOCETHTOOL failed");
 		tester_test_failed();
+		close(sk);
 		return;
 	}
 	close(sk);