diff mbox

[PULL,34/47] microblaze: fix memory leak

Message ID 5e8040e92d13f0463517616a00ad42af48438450.1425488753.git.mjt@msgid.tls.msk.ru
State New
Headers show

Commit Message

Michael Tokarev March 4, 2015, 5:06 p.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

When not assign a -dtb argument, the variable dtb_filename
storage returned from qemu_find_file(), which should be freed
after using.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/microblaze/boot.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 38c59db..e3c1c51 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -205,5 +205,7 @@  void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                             kernel_cmdline,
                             dtb_filename);
     }
-
+    if (!dtb_arg) {
+        g_free(dtb_filename);
+    }
 }