mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
731c1e90e8
commit
54f852f094
|
@ -324,8 +324,14 @@ static bool GunzipFile(const ContentInfo *ci)
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (fin != NULL) gzclose(fin);
|
if (fin != NULL) {
|
||||||
if (ftmp != NULL) fclose(ftmp);
|
/* 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);
|
if (fout != NULL) fclose(fout);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue