mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-05 16:56:54 +08:00
Fix(engine): mutex never unlocked on error (#456)
* fix error when mutex never unlock --------- Co-authored-by: devil666face <artem1999k@gmail.com> Co-authored-by: Jason Lyu <xjasonlyu@gmail.com>
This commit is contained in:
@@ -62,6 +62,8 @@ func Insert(k *Key) {
|
||||
|
||||
func start() error {
|
||||
_engineMu.Lock()
|
||||
defer _engineMu.Unlock()
|
||||
|
||||
if _defaultKey == nil {
|
||||
return errors.New("empty key")
|
||||
}
|
||||
@@ -75,7 +77,6 @@ func start() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
_engineMu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user