summaryrefslogtreecommitdiffstats
path: root/resources/utilities/ich9deblob
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-12-25 18:15:58 (EST)
committer Francis Rowe <info@gluglug.org.uk>2014-12-25 18:15:58 (EST)
commita704784969a88bb9ea42e9c94877e65989b54203 (patch)
treeaa6f36bd318f6a0e6155a37a426b80af5087364c /resources/utilities/ich9deblob
parente91830663943e36417dde6f549807a91b4d6af88 (diff)
downloadlibreboot-a704784969a88bb9ea42e9c94877e65989b54203.zip
libreboot-a704784969a88bb9ea42e9c94877e65989b54203.tar.gz
libreboot-a704784969a88bb9ea42e9c94877e65989b54203.tar.bz2
ich9deblob: close file if there are errors
Diffstat (limited to 'resources/utilities/ich9deblob')
-rw-r--r--resources/utilities/ich9deblob/src/ich9deblob.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/resources/utilities/ich9deblob/src/ich9deblob.c b/resources/utilities/ich9deblob/src/ich9deblob.c
index ee549d2..313416c 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");