diff --git a/server/handler/tarball.go b/server/handler/tarball.go index e98feda0a0..baa395670c 100644 --- a/server/handler/tarball.go +++ b/server/handler/tarball.go @@ -42,17 +42,13 @@ func (h *tarballUploader) upload(r *http.Request) (*simpleResponse, statusError) sid := mux.Vars(r)["sid"] logprinter.Infof("Uploading tarball, sid: %s", sid) - if err := r.ParseMultipartForm(MaxMemory); err != nil { - // TODO: log error here - return nil, ErrorInvalidTarball - } - file, handler, err := r.FormFile("file") if err != nil { // TODO: log error here return nil, ErrorInvalidTarball } defer file.Close() + defer r.MultipartForm.RemoveAll() if err := h.sm.Write(sid, handler.Filename, file); err != nil { logprinter.Errorf("Error to write tarball: %s", err.Error()) diff --git a/tools/check/golangci.yaml b/tools/check/golangci.yaml index b5ad990650..f7bc9167c5 100644 --- a/tools/check/golangci.yaml +++ b/tools/check/golangci.yaml @@ -2,6 +2,9 @@ linters-settings: govet: enable: - nilness + errcheck: + exclude-functions: + - (*mime/multipart.Form).RemoveAll linters: disable-all: true