summary refs log tree commit diff stats
path: root/hw/arm/omap_sx1.c
diff options
context:
space:
mode:
authorShannon Zhao <shannon.zhao@linaro.org>2015-05-29 13:38:34 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2015-06-03 14:21:24 +0300
commit9f9b026dc60398224fb035eb27ae0ed083d2d66f (patch)
treeaa8e8762702897fa0795004e8d94541d94eeb4bb /hw/arm/omap_sx1.c
parentf19377bf234a3359b0a03844822e97de80ad4f30 (diff)
downloadfocaccia-qemu-9f9b026dc60398224fb035eb27ae0ed083d2d66f.tar.gz
focaccia-qemu-9f9b026dc60398224fb035eb27ae0ed083d2d66f.zip
hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/arm/omap_sx1.c')
-rw-r--r--hw/arm/omap_sx1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 671e02c4ed..4b0f7f9c42 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -103,7 +103,6 @@ static void sx1_init(MachineState *machine, const int version)
     struct omap_mpu_state_s *mpu;
     MemoryRegion *address_space = get_system_memory();
     MemoryRegion *flash = g_new(MemoryRegion, 1);
-    MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
     MemoryRegion *cs = g_new(MemoryRegion, 4);
     static uint32_t cs0val = 0x00213090;
     static uint32_t cs1val = 0x00215070;
@@ -165,6 +164,7 @@ static void sx1_init(MachineState *machine, const int version)
 
     if ((version == 1) &&
             (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
+        MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
         memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0", flash1_size,
                                &error_abort);
         vmstate_register_ram_global(flash_1);