mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-20 02:46:04 +00:00
Address minor file descriptor leak in CollectTar.
Before this commit, the reader opened by `GetBlob` was not closed. This does not matter for the current implementation of the S3 backend, but for the FS backend the file descriptor was only closed by the `os.file` finalizer. V12-Ref: F-77205
This commit is contained in:
@@ -72,6 +72,9 @@ func CollectTar(
|
||||
return
|
||||
}
|
||||
blobData, err = io.ReadAll(blobReader)
|
||||
if closer, ok := blobReader.(io.Closer); ok {
|
||||
defer closer.Close()
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user