mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
device: remove nil elem check in finalizers
This is not necessary, and removing it speeds up detection of UAF bugs. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
9e728c2eb0
commit
ecceaadd16
@ -87,9 +87,6 @@ func newAutodrainingInboundQueue(device *Device) *autodrainingInboundQueue {
|
||||
for {
|
||||
select {
|
||||
case elem := <-q.c:
|
||||
if elem == nil {
|
||||
continue
|
||||
}
|
||||
elem.Lock()
|
||||
device.PutMessageBuffer(elem.buffer)
|
||||
device.PutInboundElement(elem)
|
||||
@ -118,9 +115,6 @@ func newAutodrainingOutboundQueue(device *Device) *autodrainingOutboundQueue {
|
||||
for {
|
||||
select {
|
||||
case elem := <-q.c:
|
||||
if elem == nil {
|
||||
continue
|
||||
}
|
||||
elem.Lock()
|
||||
device.PutMessageBuffer(elem.buffer)
|
||||
device.PutOutboundElement(elem)
|
||||
|
Loading…
Reference in New Issue
Block a user