diff --git a/api/sessionrecording/session_recording.go b/api/sessionrecording/session_recording.go index 4927e3aed329c..02164aeeb253b 100644 --- a/api/sessionrecording/session_recording.go +++ b/api/sessionrecording/session_recording.go @@ -261,7 +261,7 @@ func (r *Reader) Read(ctx context.Context) (apievents.AuditEvent, error) { if _, err := io.ReadFull(r.gzipReader, messageBytes[:messageSize]); err != nil { return nil, r.setError(trace.ConvertSystemError(err)) } - oneof := apievents.OneOf{} + var oneof apievents.OneOf if err := oneof.Unmarshal(messageBytes[:messageSize]); err != nil { return nil, trace.Wrap(err) }