We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72b8264 commit e77d58cCopy full SHA for e77d58c
1 file changed
packages/pam/handlers/ssh/sftp_parser.go
@@ -65,6 +65,14 @@ func (p *SFTPParser) Parse(data []byte) []SFTPOperation {
65
}
66
67
68
+ // Compact buffer to release consumed memory
69
+ // Without this, the backing array grows indefinitely during long sessions
70
+ if len(p.buffer) > 0 {
71
+ p.buffer = append([]byte(nil), p.buffer...)
72
+ } else {
73
+ p.buffer = p.buffer[:0]
74
+ }
75
+
76
return operations
77
78
0 commit comments