From 5f771dca27dd54c1eb5857344caf235cab83e568 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 15 Dec 2016 14:51:08 +0100 Subject: util/broadcom: close file on error Change-Id: I5193c6a9f08398b881c971c7175654ba5775b34a Signed-off-by: Patrick Georgi Found-by: Coverity Scan #1323509 Reviewed-on: https://review.coreboot.org/17876 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/broadcom/secimage/io.c | 1 + 1 file changed, 1 insertion(+) (limited to 'util') 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); -- cgit v1.2.3