mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
client: close TCP connection when fmux session creation fails (#5262)
If realConnect() succeeds but fmux.Client returns an error, the connection was not assigned to the connector and would leak.
This commit is contained in:
parent
76abeff881
commit
98ee1adb13
1 changed files with 1 additions and 0 deletions
|
|
@ -119,6 +119,7 @@ func (c *defaultConnectorImpl) Open() error {
|
|||
fmuxCfg.MaxStreamWindowSize = 6 * 1024 * 1024
|
||||
session, err := fmux.Client(conn, fmuxCfg)
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return err
|
||||
}
|
||||
c.muxSession = session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue