diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index 522405b2800e..5098022e86ea 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -827,6 +827,7 @@ func handleBinary(ctx context.Context, repo *git.Repository, chunksChan chan *so if err != nil { return err } + defer reader.Close() if handlers.HandleFile(ctx, reader, chunkSkel, chunksChan) { return nil diff --git a/pkg/sources/s3/s3.go b/pkg/sources/s3/s3.go index 07b88e2aecd5..cce0e0748bf8 100644 --- a/pkg/sources/s3/s3.go +++ b/pkg/sources/s3/s3.go @@ -278,6 +278,7 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan s.log.Error(err, "Could not create reader.") return } + defer reader.Close() email := "Unknown" if obj.Owner != nil {