mirror of https://github.com/madler/zlib.git
A problem surfaced in a multi-threaded application where fileno() was used to get a file descriptor from an fopen(), which was then fed to gzdopen(). The problem occurred when the gzclose() followed by the fclose() tried to close the same file descriptor twice. If fclose() were not done, there would be a memory leak. The only way out is to dup() the file descriptor so that gzclose() closes the duplicated file descriptor, and fclose() closes the original file descriptor.pull/2/head
parent
5ab9f47745
commit
6dbf1d1026
1 changed files with 5 additions and 1 deletions
Loading…
Reference in new issue