Skip to content

Find, verify, and analyze leaked credentials

Close files to clean up tmp files (#940)

Bill Richf1ec9e74eb1b
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index 522405b28..5098022e8 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 07b88e2ae..cce0e0748 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 {