diff mbox series

[Bluez,V2,05/13] Fixing leaked_handle in cltest.c

Message ID 20220531074117.610321-6-gopalkrishna.tiwari@gmail.com
State New
Headers show
Series Fixing memory leak, leaked_handle and use_after | expand

Commit Message

Gopal Tiwari May 31, 2022, 7:41 a.m. UTC
From: Gopal Tiwari <gtiwari@redhat.com>

While performing static tool analysis using coverity found 
following reports for resouse leak

bluez-5.64/tools/cltest.c:75: leaked_handle: Handle variable "fd" 
going out of scope leaks the handle.

Signed-off-by: Gopal Tiwari <gtiwari@redhat.com>
---
 tools/cltest.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/cltest.c b/tools/cltest.c
index 2766fcd23..250c93cc7 100644
--- a/tools/cltest.c
+++ b/tools/cltest.c
@@ -72,6 +72,7 @@  static bool send_message(const bdaddr_t *src, const bdaddr_t *dst,
 		return false;
 	}
 
+	close(fd);
 	return true;
 }