aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/alpine
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-10-25 21:24:24 +0200
committerGitHub <noreply@github.com>2023-10-25 21:24:24 +0200
commitab3f6c1bac04ea43541d9abd5e7c21a67b0f6deb (patch)
tree14830db21625882479bd2bf4991e71d2dc153fee /services/packages/alpine
parent46dd02702d29548c4de3e55842faa5694ef69b8a (diff)
downloadgitea-ab3f6c1bac04ea43541d9abd5e7c21a67b0f6deb.tar.gz
gitea-ab3f6c1bac04ea43541d9abd5e7c21a67b0f6deb.zip
Close all hashed buffers (#27787)
Add missing `.Close()` calls. The current code does not delete the temporary files if the data grows over 32mb.
Diffstat (limited to 'services/packages/alpine')
-rw-r--r--services/packages/alpine/repository.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/packages/alpine/repository.go b/services/packages/alpine/repository.go
index eeda0cca7b..46093d5bdd 100644
--- a/services/packages/alpine/repository.go
+++ b/services/packages/alpine/repository.go
@@ -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,