qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, weidong.huang@huawei.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] spice: fix memory leak
Date: Fri, 05 Dec 2014 05:56:58 -0700	[thread overview]
Message-ID: <5481AB9A.9020706@redhat.com> (raw)
In-Reply-To: <1417768210-9688-1-git-send-email-arei.gonglei@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

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...

> ---
> 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>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-12-05 12:57 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 [this message]
2014-12-08  0:07   ` Gonglei
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=5481AB9A.9020706@redhat.com \
    --to=eblake@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).