cltest: Fix leaked_handle
authorGopal Tiwari <gtiwari@redhat.com>
Tue, 31 May 2022 07:41:09 +0000 (13:11 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
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: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/cltest.c

index 2766fcd..250c93c 100755 (executable)
@@ -72,6 +72,7 @@ static bool send_message(const bdaddr_t *src, const bdaddr_t *dst,
                return false;
        }
 
+       close(fd);
        return true;
 }