wgengine: don't leak TUN device in NewUserspaceEngine error path

Updates #1187

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/1219/head
Brad Fitzpatrick 4 years ago committed by Brad Fitzpatrick
parent 9f5b0d058f
commit 4d943536f1

@ -194,6 +194,7 @@ func NewUserspaceEngine(logf logger.Logf, tunname string, listenPort uint16) (En
e, err := NewUserspaceEngineAdvanced(conf)
if err != nil {
tun.Close()
return nil, err
}
return e, err

Loading…
Cancel
Save