wgengine: don't leak TUN device in NewUserspaceEngine error path
Updates
@@ -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
