diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2016-12-15 14:51:08 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2016-12-16 15:54:51 +0100 |
commit | 5f771dca27dd54c1eb5857344caf235cab83e568 (patch) | |
tree | b9adc2fbcd856803d2e2e56b048d9507d665f57e /util/broadcom/secimage/io.c | |
parent | 1d1e141f2e2c44de514f34ae22e074e9a8718b7a (diff) |
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>
Diffstat (limited to 'util/broadcom/secimage/io.c')
-rw-r--r-- | util/broadcom/secimage/io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/util/broadcom/secimage/io.c b/util/broadcom/secimage/io.c index c32a06dc7a..d71065c9c4 100644 --- a/util/broadcom/secimage/io.c +++ b/util/broadcom/secimage/io.c @@ -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); |