[Spice-devel] [spice-gtk v1 2/2] file-xfer: fix file path leak

Victor Toso victortoso at redhat.com
Thu May 12 20:57:12 UTC 2016


On Thu, May 12, 2016 at 10:52:09PM +0200, Fabiano FidĂȘncio wrote:
> On Thu, May 12, 2016 at 10:42 PM, Victor Toso <victortoso at redhat.com> wrote:
> > ---
> >  src/channel-main.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/channel-main.c b/src/channel-main.c
> > index fb0630e..2e2fe86 100644
> > --- a/src/channel-main.c
> > +++ b/src/channel-main.c
> > @@ -2956,8 +2956,10 @@ static void spice_file_transfer_task_completed(SpiceFileTransferTask *self,
> >      if (self->priv->error)
> >          g_clear_error(&error);
> >      if (error) {
> > +        gchar *path = g_file_get_path(self->priv->file);
> >          SPICE_DEBUG("File %s xfer failed: %s",
> > -                    g_file_get_path(self->priv->file), error->message);
> > +                    path, error->message);
> > +        g_free(path);
> >          self->priv->error = error;
> >      }
> >
> > --
> > 2.5.5
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
> Acked-by: Fabiano FidĂȘncio <fidencio at redhat.com>
>
> Just out of curiosity, did you get it just by reading the code or on
> valgrind usage?

valgrind

> -- 
> Fabiano FidĂȘncio


More information about the Spice-devel mailing list