mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10: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 <[email protected]> Cc: Leon Alrae <[email protected]> Signed-off-by: Gonglei <[email protected]> Reviewed-by: Leon Alrae <[email protected]> Signed-off-by: Michael Tokarev <[email protected]>
This commit is contained in:
1 parent
5403432f39
commit
3ad9fd5a25
3 files changed
+3
No files matched your search
@@ -168,6 +168,7 @@ static int64_t load_kernel (CPUMIPSState *env)
|
||||
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
||||
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
||||
|
||||
g_free(prom_buf);
|
||||
return kernel_entry;
|
||||
}
|
||||
|
||||
|
||||
@@ -861,6 +861,7 @@ static int64_t load_kernel (void)
|
||||
rom_add_blob_fixed("prom", prom_buf, prom_size,
|
||||
cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
|
||||
|
||||
g_free(prom_buf);
|
||||
return kernel_entry;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ static int64_t load_kernel(void)
|
||||
rom_add_blob_fixed("params", params_buf, params_size,
|
||||
(16 << 20) - 264);
|
||||
|
||||
g_free(params_buf);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user