[Spice-devel] [PATCH spice-gtk 2/6] spice-channel: plug a small memory leak

Christophe Fergeau cfergeau at redhat.com
Thu Oct 18 08:13:49 PDT 2012


On Fri, Aug 24, 2012 at 03:58:15PM +0200, Marc-André Lureau wrote:
> ---
>  gtk/spice-channel.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 54d406d..37198f5 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -1346,6 +1346,7 @@ static gboolean spice_channel_perform_auth_sasl(SpiceChannel *channel)
>           g_socket_address_get_family(addr) == G_SOCKET_FAMILY_IPV6) &&
>          (localAddr = addr_to_string(addr)) == NULL)
>          goto error;
> +    g_object_unref(addr);
>  
>      /* Get remote address in form  IPADDR:PORT */
>      addr = g_socket_get_remote_address(c->sock, NULL);
> @@ -1357,6 +1358,7 @@ static gboolean spice_channel_perform_auth_sasl(SpiceChannel *channel)
>           g_socket_address_get_family(addr) == G_SOCKET_FAMILY_IPV6) &&
>          (remoteAddr = addr_to_string(addr)) == NULL)
>          goto error;
> +    g_object_unref(addr);

You also need to do this in the error branch, ACK otherwise

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20121018/cb57b412/attachment.pgp>


More information about the Spice-devel mailing list