mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-06 03:15:03 +00:00
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: Martin Holst Swende <martin@swende.se>
This commit is contained in:
parent
0ddd4612b7
commit
eebfb13053
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue