diff --git a/relay/dataplane/s3_client.go b/relay/dataplane/s3_client.go index 3e2e57599..fa92a9c7e 100644 --- a/relay/dataplane/s3_client.go +++ b/relay/dataplane/s3_client.go @@ -44,6 +44,7 @@ func NewS3Client( sess, err := session.NewSession(config.AWSConfig) if err != nil { + cancel() return nil, err } svc := s3.New(sess) @@ -145,7 +146,7 @@ func (s *s3Client) createBucketIfNeeded() error { if err == nil { // Bucket exists return nil - } else if s.config.AutoCreateBucket == false { + } else if !s.config.AutoCreateBucket { return err }