From 05c2784b174aecbdf2bb537f0dafc5bdc1f3da2b Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 2 Apr 2011 16:07:49 +0200 Subject: [PATCH] Don't leak the old socket when using STARTTLS. --- src/XMPPConnection.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index d2d8048..c69a380 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -346,7 +346,10 @@ if ([[elem namespace] isEqual: XMPP_NS_STARTTLS]) { if ([[elem name] isEqual: @"proceed"]) { /* FIXME: Catch errors here */ - sock = [[SSLSocket alloc] initWithSocket: sock]; + SSLSocket *newSock = [[SSLSocket alloc] + initWithSocket: sock]; + [sock release]; + sock = newSock; /* Stream restart */ [parser setDelegate: self];