summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-10-01 15:36:22 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-10-04 18:49:16 +0200
commit100781a8cd61927d8442bd0b02dfc10c5bb89bcb (patch)
tree23ce24f00eddfeb7f142254c6020222374a45ac3
parentf5f72e8f31f22ba5ee43db5cb9481206fc661f76 (diff)
downloadfocaccia-qemu-100781a8cd61927d8442bd0b02dfc10c5bb89bcb.tar.gz
focaccia-qemu-100781a8cd61927d8442bd0b02dfc10c5bb89bcb.zip
microblaze: fix leak of fdevice tree blob
The device tree blob returned by load_device_tree is malloced.
Free it before returning.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r--hw/microblaze/boot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index bade4d22c0..d1d7dfbbb9 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -100,6 +100,7 @@ static int microblaze_load_dtb(hwaddr addr,
     }
 
     cpu_physical_memory_write(addr, fdt, fdt_size);
+    g_free(fdt);
     return fdt_size;
 }