diff --git a/dialer.go b/dialer.go index 8e9f32c..e983088 100644 --- a/dialer.go +++ b/dialer.go @@ -136,9 +136,8 @@ func (d *customDialer) writeWARCFromConnection(reqPipe, respPipe *io.PipeReader, close(recordChan) if err != nil { d.client.errChan <- err - // Make sure we close the WARC content buffers - for _, record := range batch.Records { + for record := range recordChan { record.Content.Close() }