Skip to content

Commit

Permalink
fix: close file in the Upload func (go-gitea#30262)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored and GiteaBot committed Apr 3, 2024
1 parent 47de6e3 commit 2ef372e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/lfs/filesystem_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2ef372e

Please sign in to comment.