summaryrefslogtreecommitdiffstats
path: root/routers/repo/download.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-10-16 06:55:31 +0100
committerGitHub <noreply@github.com>2019-10-16 06:55:31 +0100
commite1505d62507dde9694f87abe6f82a5887e3c12d8 (patch)
tree743ea5c95d20bf99da7f445687bfaaf69fdbee57 /routers/repo/download.go
parent31655aabfc397db203d39b468cad1ecbdc1879db (diff)
downloadgitea-e1505d62507dde9694f87abe6f82a5887e3c12d8.tar.gz
gitea-e1505d62507dde9694f87abe6f82a5887e3c12d8.zip
Add missed close in ServeBlobLFS (#8527)
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r--routers/repo/download.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index 2da8b109ca..6f10fe36a3 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -84,6 +84,11 @@ func ServeBlobOrLFS(ctx *context.Context, blob *git.Blob) error {
if err != nil {
return err
}
+ defer func() {
+ if err = lfsDataRc.Close(); err != nil {
+ log.Error("ServeBlobOrLFS: Close: %v", err)
+ }
+ }()
return ServeData(ctx, ctx.Repo.TreePath, lfsDataRc)
}