util/broadcom: close file on error

Change-Id: I5193c6a9f08398b881c971c7175654ba5775b34a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323509
Reviewed-on: https://review.coreboot.org/17876
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Georgi 2016-12-15 14:51:08 +01:00 committed by Patrick Georgi
parent 1d1e141f2e
commit 5f771dca27
1 changed files with 1 additions and 0 deletions

View File

@ -81,6 +81,7 @@ int DataRead(char *filename, uint8_t *buf, int *length)
if (fread((uint8_t *)buf, 1, len, file) != len) {
printf("Error reading data (%d bytes) from file: %s\n",
len, filename);
fclose(file);
return -1;
}
fclose(file);