* [PATCH] l2cap-tester: Close sk in error path
@ 2013-12-12 7:48 Andrei Emeltchenko
2013-12-12 7:57 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2013-12-12 7:48 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This fixes resource leak warnings.
---
tools/l2cap-tester.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index 505ac79..e4dade2 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -503,6 +503,7 @@ static int create_l2cap_sock(struct test_data *data, uint16_t psm)
master_bdaddr = hciemu_get_master_bdaddr(data->hciemu);
if (!master_bdaddr) {
tester_warn("No master bdaddr");
+ close(sk);
return -ENODEV;
}
@@ -701,6 +702,7 @@ static void test_server(const void *test_data)
tester_warn("listening on socket failed: %s (%u)",
strerror(errno), errno);
tester_test_failed();
+ close(sk);
return;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] l2cap-tester: Close sk in error path
2013-12-12 7:48 [PATCH] l2cap-tester: Close sk in error path Andrei Emeltchenko
@ 2013-12-12 7:57 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2013-12-12 7:57 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
Hi Andrei,
On Thu, Dec 12, 2013, Andrei Emeltchenko wrote:
> This fixes resource leak warnings.
> ---
> tools/l2cap-tester.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-12 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 7:48 [PATCH] l2cap-tester: Close sk in error path Andrei Emeltchenko
2013-12-12 7:57 ` Johan Hedberg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.