Commit ecb75486 authored by Robert Griesemer's avatar Robert Griesemer

container/list: avoid memory leaks

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7065067
parent 74c03cb8
......@@ -108,6 +108,8 @@ func (l *List) insertValue(v interface{}, at *Element) *Element {
func (l *List) remove(e *Element) *Element {
e.prev.next = e.next
e.next.prev = e.prev
e.next = nil // avoid memory leaks
e.prev = nil // avoid memory leaks
e.list = nil
l.len--
return e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment