summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs_image.h
diff options
context:
space:
mode:
authorSol Boucher <solb@chromium.org>2015-05-05 15:40:15 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-05-08 20:23:23 +0200
commit3e060ed112c5ec3a5fa58b68174dd57708af1d89 (patch)
treef0b940cf9e72e9c5120764d281556c9440d7f8c8 /util/cbfstool/cbfs_image.h
parent297c88c35748ecd1f82fc96b71e10b118c587c71 (diff)
downloadcoreboot-3e060ed112c5ec3a5fa58b68174dd57708af1d89.tar.xz
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 <solb@chromium.org> Reviewed-on: http://review.coreboot.org/10130 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r--util/cbfstool/cbfs_image.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index 1c2b6fd56e..51d06dca23 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -28,7 +28,7 @@
struct cbfs_image {
struct buffer buffer;
- struct cbfs_header *header;
+ struct cbfs_header header;
};
/* Given a pointer, serialize the header from host-native byte format