Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jar: close the zip.File reader before recursing
Package archive/zip has a pool [1] for flate buffers. Calling `Close` on the result of `zip.(*File).Open` returns the buffer to the pool. We should do this as soon as we are able (when we no longer need the file), especially before recursing. I did not modify the `defer f.Close()` in the code paths above because: 1. The `return` follows closely after (no recursion) in their case. And: 2. They actually use the file for longer. [1]: https://cs.opensource.google/go/go/+/master:src/archive/zip/register.go;l=69;drc=1b09d430678d4a6f73b2443463d11f75851aba8a.
- Loading branch information