From 8132480b825f7a116a05fc720935f6c6b81b7baf Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 19 Nov 2016 12:20:31 +0100 Subject: [PATCH] close socket after failed stream open --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index a1bd5ccfa..128e1187c 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -396,8 +396,11 @@ public class XmppConnection implements Runnable { throw new SecurityException(); } } - if (startXmpp(localSocket)) + if (startXmpp(localSocket)) { break; // successfully connected to server that speaks xmpp + } else { + localSocket.close(); + } } catch (final SecurityException e) { throw e; } catch (InterruptedException e) {