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:
parent
1d1e141f2e
commit
5f771dca27
|
@ -81,6 +81,7 @@ int DataRead(char *filename, uint8_t *buf, int *length)
|
||||||
if (fread((uint8_t *)buf, 1, len, file) != len) {
|
if (fread((uint8_t *)buf, 1, len, file) != len) {
|
||||||
printf("Error reading data (%d bytes) from file: %s\n",
|
printf("Error reading data (%d bytes) from file: %s\n",
|
||||||
len, filename);
|
len, filename);
|
||||||
|
fclose(file);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
Loading…
Reference in New Issue