util/cbfstool: Fix memory leak

Change-Id: I66cb1c88155ef58610bacfb899e0132e4143c7ac
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1325836
Reviewed-on: https://review.coreboot.org/17859
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Patrick Georgi 2016-12-14 16:10:00 +01:00 committed by Patrick Georgi
parent a2ce710df7
commit 862df924e3
1 changed files with 1 additions and 0 deletions

View File

@ -1411,6 +1411,7 @@ int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
ntohl(entry->len), hash_type, local_hash,
hash_len) != VB2_SUCCESS) {
fprintf(fp, "failed to hash '%s'\n", name);
free(hash_str);
break;
}
int valid = memcmp(local_hash, hash->hash_data, hash_len) == 0;