qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/6] smbus: fix memory leak
Date: Thu, 3 Mar 2016 12:19:06 +0100	[thread overview]
Message-ID: <56D81DAA.3040201@redhat.com> (raw)
In-Reply-To: <1456998223-12356-7-git-send-email-arei.gonglei@huawei.com>



On 03/03/2016 10:43, Gonglei wrote:
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  hw/i2c/smbus_eeprom.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
> index 5b7bd89..83c6b27 100644
> --- a/hw/i2c/smbus_eeprom.c
> +++ b/hw/i2c/smbus_eeprom.c
> @@ -156,4 +156,6 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,
>          qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
>          qdev_init_nofail(eeprom);
>      }
> +
> +    g_free(eeprom_buf);
>  }
> 

This is wrong, eeprom_buf is passed to the device through qdev_prop_set_ptr.

Paolo

  reply	other threads:[~2016-03-03 11:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  9:43 [Qemu-devel] [PATCH 0/6] fix some coverity complains Gonglei
2016-03-03  9:43 ` [Qemu-devel] [PATCH 1/6] egl-helpers: fix possible resource leak Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-05-10  6:02     ` Gonglei (Arei)
2016-03-03  9:43 ` [Qemu-devel] [PATCH 2/6] sheepdog: fix possible resouce leak and out-of-bounds access Gonglei
2016-03-03 11:17   ` Paolo Bonzini
2016-03-03 12:00     ` Gonglei (Arei)
2016-03-03 12:12       ` Paolo Bonzini
2016-03-03 12:35         ` Gonglei (Arei)
2016-03-03  9:43 ` [Qemu-devel] [PATCH 3/6] spice: fix coverity complains Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-05-10  5:59     ` Gonglei (Arei)
2016-03-03  9:43 ` [Qemu-devel] [PATCH 4/6] hostmem-file: fix memory leak Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-03-03  9:43 ` [Qemu-devel] [PATCH 5/6] spapr: fix possible Negative array index read Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-03-03  9:43 ` [Qemu-devel] [PATCH 6/6] smbus: fix memory leak Gonglei
2016-03-03 11:19   ` Paolo Bonzini [this message]
2016-03-03 12:05     ` Gonglei (Arei)
2016-04-06  2:12 ` [Qemu-devel] [PATCH 0/6] fix some coverity complains Gonglei (Arei)
2016-04-06  6:30   ` Paolo Bonzini
2016-04-06  6:31     ` Paolo Bonzini

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=56D81DAA.3040201@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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).