qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "john.liuli" <john.liuli@huawei.com>
To: mjt@tls.msk.ru
Cc: qemu-trivial@nongnu.org, Li Liu <john.liuli@huawei.com>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] numa: fix qerror_report_err not free issue
Date: Sat, 30 Aug 2014 11:36:39 +0800	[thread overview]
Message-ID: <1409369799-9028-1-git-send-email-john.liuli@huawei.com> (raw)

From: Li Liu <john.liuli@huawei.com>

All qerror_report_err returned none NULL pointers need to
be freed, otherwise will cause memory leaking.

Although this place did not cause real memory leaking by exit,
obviously it's not correct to use qerror_report_err
without error_free it.

Signed-off-by: Li Liu <john.liuli@huawei.com>
---
 numa.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/numa.c b/numa.c
index c78cec9..0b4ac9b 100644
--- a/numa.c
+++ b/numa.c
@@ -298,6 +298,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
         MemoryRegion *seg = host_memory_backend_get_memory(backend, &local_err);
         if (local_err) {
             qerror_report_err(local_err);
+            error_free(local_err);
             exit(1);
         }
 
-- 
1.7.9.5

             reply	other threads:[~2014-08-30  3:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-30  3:36 john.liuli [this message]
2014-08-30  5:26 ` [Qemu-devel] [PATCH] numa: fix qerror_report_err not free issue Michael Tokarev
2014-08-30  5:28   ` Gonglei (Arei)
2014-08-30  6:24   ` Li Liu

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=1409369799-9028-1-git-send-email-john.liuli@huawei.com \
    --to=john.liuli@huawei.com \
    --cc=mjt@tls.msk.ru \
    --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).