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:
Gonglei authored and Michael Tokarev committed 2015-04-30 16:06:17 +03:00
1 parent 5403432f39
commit 3ad9fd5a25
3 files changed
+3

No files matched your search

+1
View File
@@ -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;
}
+1
View File
@@ -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;
}
+1
View File
@@ -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;
}