提交 3ad9fd5a 编写于 作者: G Gonglei 提交者: Michael Tokarev

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: NGonglei <arei.gonglei@huawei.com>
Reviewed-by: NLeon Alrae <leon.alrae@imgtec.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 5403432f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册