From 8bc39599dec491d413e937ac3ddaf795979b92f9 Mon Sep 17 00:00:00 2001 From: guangwu Date: Sat, 18 May 2024 22:14:12 +0800 Subject: [PATCH] fix: close file --- server/data/file/file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/data/file/file.go b/server/data/file/file.go index 5586f48f..785d7d57 100644 --- a/server/data/file/file.go +++ b/server/data/file/file.go @@ -78,6 +78,7 @@ func (b *Backend) AddFile(file *common.File, fileReader io.Reader) (err error) { if err != nil { return fmt.Errorf("unable to create file %s : %s", path, err) } + defer out.Close() // Copy file data from the client request body // to the file system