dgryski / semgrep-go

Go rules for semgrep and go-ruleguard
MIT License
457 stars 37 forks source link

bad defer lock #19

Closed cristaloleg closed 3 years ago

cristaloleg commented 3 years ago

See https://twitter.com/oleg_kovalov/status/1334522123449217025

dgryski commented 3 years ago

Thanks.

I wonder if m1.Lock(); m2.Unlock() ever happens ?

cristaloleg commented 3 years ago

Yep, have meet such patter 2-3 times. When you need to lock something after something. And you don't want to have a gap between this locks (which is rare but never know)