[PATCHv2 03/10] emulator: Fix resource leak closing fd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

---
 emulator/b1ee.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emulator/b1ee.c b/emulator/b1ee.c
index 17a60fc..3fb867d 100644
--- a/emulator/b1ee.c
+++ b/emulator/b1ee.c
@@ -203,6 +203,7 @@ static int do_connect(const char *node, const char *service)
 
 		if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
 			perror("Failed to connect");
+			close(fd);
 			continue;
 		}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux