From: Stefan Weil <sw@weilnetz.de>
To: Gerd Hoffmann <kraxel@redhat.com>, arei.gonglei@huawei.com
Cc: pbonzini@redhat.com, weidong.huang@huawei.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] spice: fix memory leak
Date: Mon, 08 Dec 2014 10:31:35 +0100 [thread overview]
Message-ID: <54856FF7.2000600@weilnetz.de> (raw)
In-Reply-To: <1418030754.27021.23.camel@nilsson.home.kraxel.org>
Am 08.12.2014 um 10:25 schrieb Gerd Hoffmann:
> On Fr, 2014-12-05 at 16:30 +0800, arei.gonglei@huawei.com wrote:
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> 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 <pbonzini@redhat.com>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
> Added to spice patch queue.
>
> thanks
> Gerd
Shouldn't we use g_assert instead of assert? Maybe you can fix this
without a new patch iteration.
Stefan
next prev parent reply other threads:[~2014-12-08 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 8:30 [Qemu-devel] [PATCH v2] spice: fix memory leak arei.gonglei
2014-12-05 12:56 ` Eric Blake
2014-12-08 0:07 ` Gonglei
2014-12-08 9:25 ` Gerd Hoffmann
2014-12-08 9:31 ` Stefan Weil [this message]
2014-12-08 11:42 ` Gerd Hoffmann
-- strict thread matches above, loose matches on Subject: below --
2015-02-11 16:50 Gerd Hoffmann
2015-02-12 2:14 ` Gonglei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54856FF7.2000600@weilnetz.de \
--to=sw@weilnetz.de \
--cc=arei.gonglei@huawei.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.