diff --git a/src/service/storage/handler.go b/src/service/storage/handler.go index 525d4dff..47300988 100644 --- a/src/service/storage/handler.go +++ b/src/service/storage/handler.go @@ -34,6 +34,7 @@ func New(config Config) (*Handler, error) { if err != nil { return nil, err } + defer f.Close() bytes, err := ioutil.ReadAll(f) if err != nil { diff --git a/src/service/zipClient/test/zip_test.go b/src/service/zipClient/test/zip_test.go index 422da458..5805bc9d 100644 --- a/src/service/zipClient/test/zip_test.go +++ b/src/service/zipClient/test/zip_test.go @@ -261,6 +261,7 @@ func TestSymlink(t *testing.T) { fo, err := r.File[0].Open() Expect(err).ShouldNot(HaveOccurred()) + defer fo.Close() buf := new(bytes.Buffer) _, err = io.Copy(buf, fo) Expect(err).ShouldNot(HaveOccurred())