good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit eebfb130 authored by aaronbuchwald's avatar aaronbuchwald Committed by GitHub
Browse files

core: free pointer from slice after popping element from price heap (#21572)


* Fix potential memory leak in price heap

* core: nil free pointer slice (alternative version)

Co-authored-by: default avatarMartin Holst Swende <martin@swende.se>
parent 0ddd4612
No related branches found
No related tags found
No related merge requests found
......@@ -433,6 +433,7 @@ func (h *priceHeap) Pop() interface{} {
old := *h
n := len(old)
x := old[n-1]
old[n-1] = nil
*h = old[0 : n-1]
return x
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment