qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Isaku Yamahata <yamahata@valinux.co.jp>
To: seabios@seabios.org
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] seabios: acpi: fix memory leak in build_srat().
Date: Fri, 12 Feb 2010 11:36:20 +0900	[thread overview]
Message-ID: <20100212023620.GD11930@valinux.co.jp> (raw)

numadata() is allocated for temporal use, but not freed.
free it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 src/acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index dbdca79..e2a1153 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -490,6 +490,7 @@ build_srat(void)
     srat = malloc_high(srat_size);
     if (!srat) {
         dprintf(1, "Not enough memory for srat table!\n");
+        free(numadata);
         return NULL;
     }
 
@@ -556,6 +557,7 @@ build_srat(void)
 
     build_header((void*)srat, SRAT_SIGNATURE, srat_size, 1);
 
+    free(numadata);
     return srat;
 }
 
-- 
1.6.6.1

             reply	other threads:[~2010-02-12  2:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  2:36 Isaku Yamahata [this message]
2010-02-13 23:08 ` [Qemu-devel] [PATCH] seabios: acpi: fix memory leak in build_srat() Kevin O'Connor

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=20100212023620.GD11930@valinux.co.jp \
    --to=yamahata@valinux.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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).