diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-02-06 21:09:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 21:09:02 +0100 |
commit | db2c0ccae08d830b654b4db93e554ca98e6003c5 (patch) | |
tree | ff10f6feed7898b5f10634452a14d770eca3c598 /src/script/api/game | |
parent | e3b440c9c50b39092a2f887dba9370b21369f2cb (diff) | |
download | openttd-db2c0ccae08d830b654b4db93e554ca98e6003c5.tar.xz |
Fix fdc2e85: Double close of file handles
When unpacking downloaded content, the downloaded .gz file was being opened with `fopen`, the OS file handle given to zlib, and then afterwards zlib told to close the file.
But the `FILE *` object was never closed with `fclose`, meaning the stdio library would have a hanging file object, whose file handle was now invalid or referred to a different file. This caused asserts during shutdown with Microsoft's C library in debug mode.
Fix this by properly duplicating the OS handle and `fclose`ing the `FILE *` object, before giving the handle to zlib.
Diffstat (limited to 'src/script/api/game')
0 files changed, 0 insertions, 0 deletions