aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/debian/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/packages/debian/repository.go')
-rw-r--r--services/packages/debian/repository.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/packages/debian/repository.go b/services/packages/debian/repository.go
index 25fa807351..1cc687ec87 100644
--- a/services/packages/debian/repository.go
+++ b/services/packages/debian/repository.go
@@ -196,11 +196,16 @@ func buildPackagesIndices(ctx context.Context, ownerID int64, repoVersion *packa
}
packagesContent, _ := packages_module.NewHashedBuffer()
+ defer packagesContent.Close()
packagesGzipContent, _ := packages_module.NewHashedBuffer()
+ defer packagesGzipContent.Close()
+
gzw := gzip.NewWriter(packagesGzipContent)
packagesXzContent, _ := packages_module.NewHashedBuffer()
+ defer packagesXzContent.Close()
+
xzw, _ := xz.NewWriter(packagesXzContent)
w := io.MultiWriter(packagesContent, gzw, xzw)
@@ -323,6 +328,8 @@ func buildReleaseFiles(ctx context.Context, ownerID int64, repoVersion *packages
}
inReleaseContent, _ := packages_module.NewHashedBuffer()
+ defer inReleaseContent.Close()
+
sw, err := clearsign.Encode(inReleaseContent, e.PrivateKey, nil)
if err != nil {
return err
@@ -367,11 +374,14 @@ func buildReleaseFiles(ctx context.Context, ownerID int64, repoVersion *packages
sw.Close()
releaseGpgContent, _ := packages_module.NewHashedBuffer()
+ defer releaseGpgContent.Close()
+
if err := openpgp.ArmoredDetachSign(releaseGpgContent, e, bytes.NewReader(buf.Bytes()), nil); err != nil {
return err
}
releaseContent, _ := packages_module.CreateHashedBufferFromReader(&buf)
+ defer releaseContent.Close()
for _, file := range []struct {
Name string