summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-10-20 09:07:58 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-10-20 09:07:58 -0700
commit6dbf1d10263dbf2f49d12d788f89ab308ba4ca6d (patch)
tree64e85e4c0341acf45b7d78c08edaee64161fc0a5 /old
parent5ab9f47745fe9353291b217f705086b6070575d5 (diff)
downloadzlib-6dbf1d10263dbf2f49d12d788f89ab308ba4ca6d.tar.gz
zlib-6dbf1d10263dbf2f49d12d788f89ab308ba4ca6d.tar.bz2
zlib-6dbf1d10263dbf2f49d12d788f89ab308ba4ca6d.zip
Add comment to gzdopen() in zlib.h to use dup() when using fileno().
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.
Diffstat (limited to 'old')
0 files changed, 0 insertions, 0 deletions