mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
(svn r15552) -Fix (r15544): some compiler/OS combinations don't like closing the same FD twice and zlib's docs weren't very clear about whether it would close a FD it didn't open.
This commit is contained in:
@@ -324,8 +324,14 @@ static bool GunzipFile(const ContentInfo *ci)
|
||||
}
|
||||
|
||||
exit:
|
||||
if (fin != NULL) gzclose(fin);
|
||||
if (ftmp != NULL) fclose(ftmp);
|
||||
if (fin != NULL) {
|
||||
/* Closes ftmp too! */
|
||||
gzclose(fin);
|
||||
} else if (ftmp != NULL) {
|
||||
/* In case the gz stream was opened correctly this will
|
||||
* be closed by gzclose. */
|
||||
fclose(ftmp);
|
||||
}
|
||||
if (fout != NULL) fclose(fout);
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user