2014-01-09 09:01:22

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] btproxy: Fix double close

From: Andrei Emeltchenko <[email protected]>

setup_streams() already makes close()
---
tools/btproxy.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/btproxy.c b/tools/btproxy.c
index 1573587..f872326 100644
--- a/tools/btproxy.c
+++ b/tools/btproxy.c
@@ -411,11 +411,8 @@ static void server_callback(int fd, uint32_t events, void *user_data)

printf("New client connected\n");

- if (!setup_streams(src_fd, src_type_rx, src_type_tx, dst_fd)) {
- close(dst_fd);
- close(src_fd);
+ if (!setup_streams(src_fd, src_type_rx, src_type_tx, dst_fd))
return;
- }

client_active = true;
}
--
1.8.3.2



2014-01-13 08:42:29

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] btproxy: Fix double close

Hi Andrei,

On Thu, Jan 09, 2014, Andrei Emeltchenko wrote:
> setup_streams() already makes close()
> ---
> tools/btproxy.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)

Applied. Thanks.

Johan