Skip to content

Commit

Permalink
Avoid closing nil tls connection #919
Browse files Browse the repository at this point in the history
  • Loading branch information
pb376 committed Sep 28, 2022
1 parent 37a46a2 commit 106c7f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions implant/sliver/transports/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ func mtlsBeacon(uri *url.URL) *Beacon {
return mtls.WriteEnvelope(conn, envelope)
},
Close: func() error {
err = conn.Close()
if err != nil {
return err
if conn != nil {
err = conn.Close()
if err != nil {
return err
}
conn = nil
}
conn = nil
return nil
},
Cleanup: func() error {
Expand Down

0 comments on commit 106c7f0

Please sign in to comment.