summaryrefslogtreecommitdiff
path: root/tools/rctest.c
diff options
context:
space:
mode:
authorAnchit Narang <anchit.n@samsung.com>2015-07-30 12:20:03 +0530
committerJohan Hedberg <johan.hedberg@intel.com>2015-07-30 10:54:17 +0300
commit1a4d4515b6187bd0a81e604d068649a1270edcb6 (patch)
treee89b65a5b4953345fcaffa18afa795e2f2884cdc /tools/rctest.c
parent3d7511210b065169fdc4d87471d24459ccb46eff (diff)
downloadbluez-1a4d4515b6187bd0a81e604d068649a1270edcb6.tar.gz
tools/rctest: Fix file descriptor leak
Closed the file before returning from do_send function.
Diffstat (limited to 'tools/rctest.c')
-rw-r--r--tools/rctest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/rctest.c b/tools/rctest.c
index 383d165e5..9169e3c2c 100644
--- a/tools/rctest.c
+++ b/tools/rctest.c
@@ -559,6 +559,7 @@ static void do_send(int sk)
}
len = read(fd, buf, data_size);
send(sk, buf, len, 0);
+ close(fd);
return;
} else {
for (i = 6; i < data_size; i++)