Re: [PATCH] coroipcc.c Avoid leak of dup'ed client file descriptor.

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

 



Dan,
thanks for patch. Ack + I've already committed (flatiron branch).

Regards,
  Honza

Dan Clark napsal(a):
> Clean up the dup'ed file descriptor on the error path.
> Avoid leaking file descriptors in client applications
> under error conditions such as the corosync daemon being down,
> or low memory conditions.
> 
> Signed-off-by: dan clark <2clarkd@xxxxxxxxx>
> ---
>  lib/coroipcc.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/coroipcc.c b/lib/coroipcc.c
> index b3a074f..774e835 100644
> --- a/lib/coroipcc.c
> +++ b/lib/coroipcc.c
> @@ -786,6 +786,8 @@ error_request_buffer:
>         memory_unmap (ipc_instance->control_buffer, 8192);
>         unlink (path_data->control_map_path);
>  error_connect:
> +       close (ipc_instance->user_app_fd);
> +       ipc_instance->user_app_fd = -1;
>         close (request_fd);
> 
>         hdb_handle_destroy (&ipc_hdb, *handle);
> 
> 
> 
> _______________________________________________
> discuss mailing list
> discuss@xxxxxxxxxxxx
> http://lists.corosync.org/mailman/listinfo/discuss
> 

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss




[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux