Re: [PATCH BlueZ] tools: Fix the sock handle leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Mar 28, 2017 at 4:12 AM,  <hyuk0512.lee@xxxxxxxxxxx> wrote:
> From: Lee Hyuk <hyuk0512.lee@xxxxxxxxxxx>
>
> This patch adds function "close" for fixing the socket handle leak.
> ---
>  tools/rfcomm.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/rfcomm.c b/tools/rfcomm.c
> index 809c240..03359be 100644
> --- a/tools/rfcomm.c
> +++ b/tools/rfcomm.c
> @@ -310,6 +310,7 @@ static void cmd_connect(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **arg
>
>                 if (setsockopt(sk, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
>                         perror("Can't set linger option");
> +                       close(sk);
>                         return;
>                 }
>         }
> --
> 1.9.1

I can probably guess where this is coming from, a static analyzer,
well guess what if the process exits right away all the fd opened are
closed so this is most likely useless.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux