[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] spice: fix memory leak
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v2] spice: fix memory leak |
Date: |
Mon, 08 Dec 2014 12:42:54 +0100 |
On Mo, 2014-12-08 at 10:31 +0100, Stefan Weil wrote:
> Am 08.12.2014 um 10:25 schrieb Gerd Hoffmann:
> > On Fr, 2014-12-05 at 16:30 +0800, address@hidden wrote:
> >> From: Gonglei <address@hidden>
> >>
> >> If errors happen for middle items of channel_list,
> >> qmp_query_spice_channels() returns NULL, and the variable
> >> cur_item going out of scope leaks the storage it points to.
> >>
> >> The flag is a compatibility thing for older spice-server
> >> versions. Meanwhile our minimum spice version requirement is
> >> new enough that we should never ever see this error, and if we
> >> do something went very seriously wrong. Let's using assert()
> >> instead of returning NULL to avoid a memory leak.
> >>
> >> Suggested-by: Paolo Bonzini <address@hidden>
> >> Signed-off-by: Gonglei <address@hidden>
> >> Reviewed-by: Eric Blake <address@hidden>
> > Added to spice patch queue.
> >
> > thanks
> > Gerd
>
>
> Shouldn't we use g_assert instead of assert?
Why? I rarely see g_assert in the tree, with the exception of tests/
cheers,
Gerd