From a704784969a88bb9ea42e9c94877e65989b54203 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Thu, 25 Dec 2014 23:15:58 +0000 Subject: ich9deblob: close file if there are errors --- resources/utilities/ich9deblob/src/ich9deblob.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'resources') diff --git a/resources/utilities/ich9deblob/src/ich9deblob.c b/resources/utilities/ich9deblob/src/ich9deblob.c index ee549d2d..313416c6 100644 --- a/resources/utilities/ich9deblob/src/ich9deblob.c +++ b/resources/utilities/ich9deblob/src/ich9deblob.c @@ -99,6 +99,7 @@ int main(int argc, char *argv[]) if (NULL == fileStream) { printf("\nerror: could not open factory.rom\n"); + fclose(fileStream); return 1; } printf("\nfactory.rom opened successfully\n"); @@ -111,6 +112,7 @@ int main(int argc, char *argv[]) if (DESCRIPTORREGIONSIZE != bufferLength) // { printf("\nerror: could not read descriptor from factory.rom (%i) bytes read\n", bufferLength); + fclose(fileStream); return 1; } printf("\ndescriptor region read successfully\n"); @@ -150,6 +152,7 @@ int main(int argc, char *argv[]) if (GBEREGIONSIZE_8K != bufferLength) { printf("\nerror: could not read GBe region from factory.rom (%i) bytes read\n", bufferLength); + fclose(fileStream); return 1; } printf("\ngbe (8KiB) region read successfully\n"); -- cgit v1.2.3-70-g09d2