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

Fabiano Fidêncio fabiano at fidencio.org
Thu May 12 20:58:40 UTC 2016


On Thu, May 12, 2016 at 10:57 PM, Victor Toso <victortoso at redhat.com> wrote:
> 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

Okay, feel free to mention it (or not) in the commit log before
pushing the patch.

>
>> --
>> Fabiano Fidêncio



-- 
Fabiano Fidêncio


More information about the Spice-devel mailing list