diff options
author | pminmax945 <pminmax945@gmail.com> | 2016-01-17 12:23:20 +0000 |
---|---|---|
committer | pminmax945 <pminmax945@gmail.com> | 2016-01-17 12:23:53 +0000 |
commit | c0e8866c13f051c4eea0c1d940b8592cd7c8075c (patch) | |
tree | de8500041c761fa6270849b7afdec47cc9808cd3 /transports | |
parent | 672e70000a79a8e994aed759e3e2e3716076f727 (diff) |
fix incorrect connection close
when obfs4 connection create failed,conn variable is
set to nil already.
Diffstat (limited to 'transports')
-rw-r--r-- | transports/obfs4/obfs4.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/transports/obfs4/obfs4.go b/transports/obfs4/obfs4.go index 5701535..40b1406 100644 --- a/transports/obfs4/obfs4.go +++ b/transports/obfs4/obfs4.go @@ -214,8 +214,9 @@ func (cf *obfs4ClientFactory) Dial(network, addr string, dialFn base.DialFunc, a if err != nil { return nil, err } + dialConn := conn if conn, err = newObfs4ClientConn(conn, ca); err != nil { - conn.Close() + dialConn.Close() return nil, err } return conn, nil |