summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/segment_heap.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2020-03-03 15:06:07 -0800
committergVisor bot <gvisor-bot@google.com>2020-03-03 15:07:09 -0800
commit371abe00f052dec37106f2dc22921bc84fb94818 (patch)
treec69ac71640185ebd93009ffb8733c6ff38e46082 /pkg/tcpip/transport/tcp/segment_heap.go
parent277a0d5a1fbe8272d4729c01ee4c6e374d047ebc (diff)
Avoid memory leaks
Properly discard segments from the segment heap. PiperOrigin-RevId: 298704074
Diffstat (limited to 'pkg/tcpip/transport/tcp/segment_heap.go')
-rw-r--r--pkg/tcpip/transport/tcp/segment_heap.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/segment_heap.go b/pkg/tcpip/transport/tcp/segment_heap.go
index 9fd061d7d..e28f213ba 100644
--- a/pkg/tcpip/transport/tcp/segment_heap.go
+++ b/pkg/tcpip/transport/tcp/segment_heap.go
@@ -41,6 +41,7 @@ func (h *segmentHeap) Pop() interface{} {
old := *h
n := len(old)
x := old[n-1]
+ old[n-1] = nil
*h = old[:n-1]
return x
}