mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Close all hashed buffers (#27787)
Add missing `.Close()` calls. The current code does not delete the temporary files if the data grows over 32mb.
This commit is contained in:
@@ -238,6 +238,8 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
|
||||
}
|
||||
|
||||
unsignedIndexContent, _ := packages_module.NewHashedBuffer()
|
||||
defer unsignedIndexContent.Close()
|
||||
|
||||
h := sha1.New()
|
||||
|
||||
if err := writeGzipStream(io.MultiWriter(unsignedIndexContent, h), "APKINDEX", buf.Bytes(), true); err != nil {
|
||||
@@ -275,6 +277,7 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
|
||||
}
|
||||
|
||||
signedIndexContent, _ := packages_module.NewHashedBuffer()
|
||||
defer signedIndexContent.Close()
|
||||
|
||||
if err := writeGzipStream(
|
||||
signedIndexContent,
|
||||
|
Reference in New Issue
Block a user