qemu-trivial.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-trivial] [PATCH 4/6] hostmem-file: fix memory leak
Date: Thu, 3 Mar 2016 12:19:33 +0100	[thread overview]
Message-ID: <56D81DC5.60709@redhat.com> (raw)
In-Reply-To: <1456998223-12356-5-git-send-email-arei.gonglei@huawei.com>



On 03/03/2016 10:43, Gonglei wrote:
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  backends/hostmem-file.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
> index fd59482..217f858 100644
> --- a/backends/hostmem-file.c
> +++ b/backends/hostmem-file.c
> @@ -51,11 +51,14 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
>      error_setg(errp, "-mem-path not supported on this host");
>  #else
>      if (!memory_region_size(&backend->mr)) {
> +        gchar *path;
>          backend->force_prealloc = mem_prealloc;
> +        path = object_get_canonical_path(OBJECT(backend));
>          memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),
> -                                 object_get_canonical_path(OBJECT(backend)),
> +                                 path,
>                                   backend->size, fb->share,
>                                   fb->mem_path, errp);
> +        g_free(path);
>      }
>  #endif
>  }
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>


  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-trivial] [PATCH 0/6] fix some coverity complains Gonglei
2016-03-03  9:43 ` [Qemu-trivial] [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-trivial] [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-trivial] [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-trivial] [PATCH 4/6] hostmem-file: fix memory leak Gonglei
2016-03-03 11:19   ` Paolo Bonzini [this message]
2016-03-03  9:43 ` [Qemu-trivial] [PATCH 5/6] spapr: fix possible Negative array index read Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-03-03  9:43 ` [Qemu-trivial] [PATCH 6/6] smbus: fix memory leak Gonglei
2016-03-03 11:19   ` Paolo Bonzini
2016-03-03 12:05     ` Gonglei (Arei)
2016-04-06  2:12 ` [Qemu-trivial] [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=56D81DC5.60709@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).