All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Eric Blake <eblake@redhat.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kraxel@redhat.com" <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] spice: fix memory leak
Date: Mon, 8 Dec 2014 08:07:35 +0800	[thread overview]
Message-ID: <5484EBC7.4090804@huawei.com> (raw)
In-Reply-To: <5481AB9A.9020706@redhat.com>

On 2014/12/5 20:56, Eric Blake wrote:

> On 12/05/2014 01:30 AM, 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>
> 
> Putting in a R-b at the same time as fundamental changes (going from two
> loops to an assert) is not something I would have done if submitting the
> patch...
> 

Yes, it's my fault :(

>> ---
>> v2: 
>>  - using assert() instead of returning NULL. (Gerd)
>>  - fix some typos. (Eric)
>>  - add Eric's R-by tag, hope Eric has no objection
>>    because of changes of v2. :)
> 
> ...but at least you caught my attention, and I am okay with v2, so you
> can keep it now.
> 

> Reviewed-by: Eric Blake <eblake@redhat.com>
> 

Thanks.

Regards,
-Gonglei

  reply	other threads:[~2014-12-08  0:08 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 [this message]
2014-12-08  9:25 ` Gerd Hoffmann
2014-12-08  9:31   ` Stefan Weil
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=5484EBC7.4090804@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=eblake@redhat.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.