Blame SOURCES/0007-l2cap-tester-Fix-leaked_handle.patch

150e62
From 4334be027ae1ad50193025c90e77a76b64464b53 Mon Sep 17 00:00:00 2001
150e62
From: Gopal Tiwari <gtiwari@redhat.com>
150e62
Date: Tue, 31 May 2022 13:11:11 +0530
150e62
Subject: [PATCH BlueZ 07/12] l2cap-tester: Fix leaked_handle
150e62
150e62
While performing static tool analysis using coverity found following
150e62
reports for resouse leak
150e62
150e62
bluez-5.64/tools/l2cap-tester.c:1712: leaked_handle: Handle variable
150e62
"new_sk" going out of scope leaks the handle.
150e62
---
150e62
 tools/l2cap-tester.c | 1 +
150e62
 1 file changed, 1 insertion(+)
150e62
150e62
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
150e62
index d78b1e29c..3f0464013 100644
150e62
--- a/tools/l2cap-tester.c
150e62
+++ b/tools/l2cap-tester.c
150e62
@@ -1709,6 +1709,7 @@ static gboolean l2cap_listen_cb(GIOChannel *io, GIOCondition cond,
150e62
 
150e62
 	if (!check_mtu(data, new_sk)) {
150e62
 		tester_test_failed();
150e62
+		close(new_sk);
150e62
 		return FALSE;
150e62
 	}
150e62
 
150e62
-- 
150e62
2.26.2
150e62