DescriptionEliminate resource leaks from zip::ZipFiles and
zip::ZipReader::OpenFromPlatformFile.
zip::ZipFiles and zip::ZipReader::OpenFromPlatformFile do not want to
take ownership of the passed-in file. On POSIX, dup the file descriptor
to pass to fopen, so that that we can safely fclose the result. On
Windows, stop closing the file handle. Fix consumers of these functions
that assumed ownership was being passed to instead close the file
themselves.
BUG=430959
Committed: https://crrev.com/b2eae6046c3aa484cc5019615f925a7bc178fa1b
Cr-Commit-Position: refs/heads/master@{#304930}
Patch Set 1 #
Total comments: 8
Patch Set 2 : Add test case, base::ScopedFD, comment for free() #
Total comments: 2
Patch Set 3 : Rename file closer, add comment, reorder ZipReader/FileWrapper, change test iteration count #
Total comments: 3
Patch Set 4 : Rename CloseFileFunc to FdCloseFileFunc, try to document ownership in zip_internal.cc #Patch Set 5 : Finish renaming CloseFileFunc to FdCloseFileFunc (submitted last patch set too soon) #Patch Set 6 : Rebasing #
Messages
Total messages: 33 (11 generated)
|