]> granicus.if.org Git - json-c/commit
Close file on error path.
authorKizuna-Meraki <z9@kizunameraki.de>
Thu, 17 Feb 2022 20:27:01 +0000 (21:27 +0100)
committerKizuna-Meraki <z9@kizunameraki.de>
Thu, 17 Feb 2022 20:27:01 +0000 (21:27 +0100)
commitd783ad76c7d0ec98da4a675f2cbb26fa65ec9b47
treedc8a8b5429c1abdc590a4170bbba91ba0873d20a
parent3b4f1e92ad19f0fae5a6c54a904f97225c70cacf
Close file on error path.

The file was only be closed when there was no error and
was being left open when there was an error. By moving
the close(fd) statement out of the if-clause, the file
can be close regardless if there is an error or not.
After the file is closed, it can be checked for errors.
random_seed.c