From 3e060ed112c5ec3a5fa58b68174dd57708af1d89 Mon Sep 17 00:00:00 2001 From: Sol Boucher Date: Tue, 5 May 2015 15:40:15 -0700 Subject: cbfstool: Fix leak in cbfs_image struct initialization This patches a memory leak on every struct cbfs_image creation that was introduced by c1d1fd850ee7b8e52bd2ea5064fab68ac0c27098. Since that commit, the CBFS master header has been copied to a separate buffer so that its endianness could be fixed all at once; unfortunately, this buffer was malloc()'d but never free()'d. To address the issue, we replace the structure's struct cbfs_header * with a struct cbfs_header to eliminate the additional allocation. Change-Id: Ie066c6d4b80ad452b366a2a95092ed45aa55d91f Signed-off-by: Sol Boucher Reviewed-on: http://review.coreboot.org/10130 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- util/cbfstool/cbfstool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/cbfstool/cbfstool.c') diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index db521d67f5e6..024c9cfc25ae 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -465,7 +465,7 @@ static int cbfs_locate(void) } if (param.top_aligned) - address = address - image.header->romsize; + address = address - image.header.romsize; cbfs_image_delete(&image); printf("0x%x\n", address); -- cgit v1.2.3