aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorguangwu <guoguangwu@magic-shield.com>2024-04-03 22:58:13 +0800
committerGitHub <noreply@github.com>2024-04-03 10:58:13 -0400
commit0ceecfc11ab4851863a5a6bc5e398d2baf7e86f6 (patch)
tree637439ff143b19940900ec003a3e8944b1249f1e /modules
parent1195be41a13d2198ab644c8558549edd74485510 (diff)
downloadgitea-0ceecfc11ab4851863a5a6bc5e398d2baf7e86f6.tar.gz
gitea-0ceecfc11ab4851863a5a6bc5e398d2baf7e86f6.zip
fix: close file in the Upload func (#30262)
Diffstat (limited to 'modules')
-rw-r--r--modules/lfs/filesystem_client.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/lfs/filesystem_client.go b/modules/lfs/filesystem_client.go
index 3503a9effc..71bef5c899 100644
--- a/modules/lfs/filesystem_client.go
+++ b/modules/lfs/filesystem_client.go
@@ -44,7 +44,7 @@ func (c *FilesystemClient) Download(ctx context.Context, objects []Pointer, call
if err != nil {
return err
}
-
+ defer f.Close()
if err := callback(p, f, nil); err != nil {
return err
}
@@ -75,7 +75,7 @@ func (c *FilesystemClient) Upload(ctx context.Context, objects []Pointer, callba
if err != nil {
return err
}
-
+ defer f.Close()
_, err = io.Copy(f, content)
return err