[PATCH BlueZ] tools: Fix the sock handle leak

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

 



From: Lee Hyuk <hyuk0512.lee@xxxxxxxxxxx>

This patch adds function "close" for fixing the socket handle leak.
---
 tools/rfcomm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/rfcomm.c b/tools/rfcomm.c
index 809c240..03359be 100644
--- a/tools/rfcomm.c
+++ b/tools/rfcomm.c
@@ -310,6 +310,7 @@ static void cmd_connect(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **arg
 
 		if (setsockopt(sk, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
 			perror("Can't set linger option");
+			close(sk);
 			return;
 		}
 	}
-- 
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