Don't leak the old socket when using STARTTLS.

This commit is contained in:
Jonathan Schleifer 2011-04-02 16:07:49 +02:00
parent 4121a434b7
commit 05c2784b17

View file

@ -346,7 +346,10 @@
if ([[elem namespace] isEqual: XMPP_NS_STARTTLS]) { if ([[elem namespace] isEqual: XMPP_NS_STARTTLS]) {
if ([[elem name] isEqual: @"proceed"]) { if ([[elem name] isEqual: @"proceed"]) {
/* FIXME: Catch errors here */ /* FIXME: Catch errors here */
sock = [[SSLSocket alloc] initWithSocket: sock]; SSLSocket *newSock = [[SSLSocket alloc]
initWithSocket: sock];
[sock release];
sock = newSock;
/* Stream restart */ /* Stream restart */
[parser setDelegate: self]; [parser setDelegate: self];