[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] uImage: free file data after copying into g

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/4] uImage: free file data after copying into guest memory
Date: Tue, 18 Nov 2008 16:07:33 -0600
User-agent: Thunderbird (X11/20080925)

Hollis Blanchard wrote:
Signed-off-by: Hollis Blanchard <address@hidden>
 loader.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/loader.c b/loader.c
index 8722909..7f4e69c 100644
--- a/loader.c
+++ b/loader.c
@@ -399,6 +399,7 @@ int load_uboot(const char *filename, target_ulong *ep, int 
cpu_physical_memory_write_rom(hdr->ih_load, data, hdr->ih_size);
+    qemu_free(data);

I notice that fd is also leaked in this path. I think a better fix is to eliminate the separate error path and introduce a return variable. The success path should just set that to hdr->ih_size.


Anthony Liguori

return hdr->ih_size;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]