Commit 6e05a12f authored by Gonglei's avatar Gonglei Committed by Michael Tokarev
Browse files

arm: fix memory leak



Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 293811f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
            error_report("Couldn't load rom image '%s'.", filename);
            exit(1);
        }
        g_free(fn);
    }
}

+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
            if (load_image_targphys("sysram.bin", 0xfff88000, filesize) < 0) {
                hw_error("Unable to load %s\n", bios_name);
            }
            g_free(sysboot_filename);
        } else {
           hw_error("Unable to find %s\n", bios_name);
        }
+2 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ static void vexpress_common_init(MachineState *machine)
     * If a bios file was provided, attempt to map it into memory
     */
    if (bios_name) {
        const char *fn;
        char *fn;

        if (drive_get(IF_PFLASH, 0, 0)) {
            error_report("The contents of the first flash device may be "
@@ -576,6 +576,7 @@ static void vexpress_common_init(MachineState *machine)
            error_report("Could not load ROM image '%s'", bios_name);
            exit(1);
        }
        g_free(fn);
    }

    /* Motherboard peripherals: the wiring is the same but the
+2 −1
Original line number Diff line number Diff line
@@ -552,7 +552,7 @@ static void create_flash(const VirtBoardInfo *vbi)
    char *nodename;

    if (bios_name) {
        const char *fn;
        char *fn;

        if (drive_get(IF_PFLASH, 0, 0)) {
            error_report("The contents of the first flash device may be "
@@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi)
            error_report("Could not load ROM image '%s'", bios_name);
            exit(1);
        }
        g_free(fn);
    }

    create_one_flash("virt.flash0", flashbase, flashsize);