mirror of https://github.com/OpenTTD/OpenTTD.git
(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:
parent
731c1e90e8
commit
54f852f094
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue