mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-28 05:50:37 +00:00
target-mips: fix memory leak
Coveristy reports that variable prom_buf/params_buf going out of scope leaks the storage it points to. Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
5403432f39
commit
3ad9fd5a25
@ -168,6 +168,7 @@ static int64_t load_kernel (CPUMIPSState *env)
|
|||||||
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
||||||
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
||||||
|
|
||||||
|
g_free(prom_buf);
|
||||||
return kernel_entry;
|
return kernel_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,6 +861,7 @@ static int64_t load_kernel (void)
|
|||||||
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
||||||
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
||||||
|
|
||||||
|
g_free(prom_buf);
|
||||||
return kernel_entry;
|
return kernel_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@ static int64_t load_kernel(void)
|
|||||||
rom_add_blob_fixed("params", params_buf, params_size,
|
rom_add_blob_fixed("params", params_buf, params_size,
|
||||||
(16 << 20) - 264);
|
(16 << 20) - 264);
|
||||||
|
|
||||||
|
g_free(params_buf);
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user