[Spice-devel] [PATCH] udscs: Avoid file descriptor leak

Victor Toso victortoso at redhat.com
Fri Nov 16 08:26:27 UTC 2018


Hi,

On Thu, Nov 15, 2018 at 10:06:57PM +0000, Frediano Ziglio wrote:
> If connection fails the socket descriptor is not closed causing
> a leak.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Acked-by: Victor Toso <victortoso at redhat.com>

> ---
>  src/udscs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/udscs.c b/src/udscs.c
> index 62abc97..7fe74b9 100644
> --- a/src/udscs.c
> +++ b/src/udscs.c
> @@ -119,6 +119,7 @@ struct udscs_connection *udscs_connect(const char *socketname,
>          if (conn->debug) {
>              syslog(LOG_DEBUG, "connect %s: %m", socketname);
>          }
> +        close(conn->fd);
>          g_free(conn);
>          return NULL;
>      }
> -- 
> 2.17.2
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20181116/af42e351/attachment.sig>


More information about the Spice-devel mailing list