mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 11:27:42 +08:00
don't leak host in case of error adding relay
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
This commit is contained in:
parent
31e3b8f805
commit
322bb9802f
@ -852,6 +852,7 @@ func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr
|
||||
|
||||
err := circuit.AddRelayTransport(ctx, host, relayOpts...)
|
||||
if err != nil {
|
||||
host.Close()
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user