[Spice-devel] [PATCH v2 spice-gtk 1/5] spice-channel: plug a small memory leak

Marc-André Lureau marcandre.lureau at gmail.com
Fri Dec 14 09:28:13 PST 2012


 Hi

On Fri, Dec 14, 2012 at 6:27 PM, Christophe Fergeau <cfergeau at redhat.com>wrote:

> On Fri, Dec 14, 2012 at 05:44:38PM +0100, 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 264d1f2..052ffce 100644
> > --- a/gtk/spice-channel.c
> > +++ b/gtk/spice-channel.c
> > @@ -1353,6 +1353,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);
> > @@ -1364,6 +1365,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 need to unref addr in the error: branch too.
>

indeed! done.



-- 
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20121214/3bc80675/attachment.html>


More information about the Spice-devel mailing list