Skip to content

Commit eebfb13

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: Martin Holst Swende <martin@swende.se>
1 parent 0ddd461 commit eebfb13

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎core/tx_list.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ func (h *priceHeap) Pop() interface{} {
433433
old := *h
434434
n := len(old)
435435
x := old[n-1]
436+
old[n-1] = nil
436437
*h = old[0 : n-1]
437438
return x
438439
}

0 commit comments

Comments
 (0)