From 60e2cdd088794613788e0a3c66e721e8b924435d Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Mon, 21 Oct 2019 10:16:45 +0200 Subject: [PATCH] Close the transport if NewSession fails The makes sure we always send the `` or `` correctly. --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index 3d7c8b4..3d3c868 100644 --- a/client.go +++ b/client.go @@ -173,6 +173,7 @@ func (c *Client) Resume(state SMState) error { // Client is ok, we now open XMPP session if c.Session, err = NewSession(c.transport, c.config, state); err != nil { + c.transport.Close() return err } c.Session.StreamId = streamId