@@ -56,6 +56,7 @@ static void clipper_init(MachineState *machine)
qemu_irq rtc_irq;
long size, i;
const char *palcode_filename;
+ char *filename;
uint64_t palcode_entry, palcode_low, palcode_high;
uint64_t kernel_entry, kernel_low, kernel_high;
@@ -102,18 +103,20 @@ static void clipper_init(MachineState *machine)
but one explicitly written for the emulation, we might as
well load it directly from and ELF image. */
palcode_filename = (bios_name ? bios_name : "palcode-clipper");
- palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, palcode_filename);
- if (palcode_filename == NULL) {
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, palcode_filename);
+ if (filename == NULL) {
hw_error("no palcode provided\n");
exit(1);
}
- size = load_elf(palcode_filename, cpu_alpha_superpage_to_phys,
+ size = load_elf(filename, cpu_alpha_superpage_to_phys,
NULL, &palcode_entry, &palcode_low, &palcode_high,
0, EM_ALPHA, 0);
if (size < 0) {
- hw_error("could not load palcode '%s'\n", palcode_filename);
+ hw_error("could not load palcode '%s'\n", filename);
+ g_free(filename);
exit(1);
}
+ g_free(filename);
/* Start all cpus at the PALcode RESET entry point. */
for (i = 0; i < smp_cpus; ++i) {