From bf6e16ca647c549fab4e6f6fc83ddc87d3ea9bc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Wed, 2 Jan 2013 20:48:35 +0100
Subject: Remove incorrect CFRelease() calls in MacOSXProxyProvider.

This avoids a potential crash when using proxies on Mac OS X.

Change-Id: I393ba03a6ffd89668e31c5dad8c0d7277601fc14

diff --git a/Swift/ChangeLog.md b/Swift/ChangeLog.md
index bef90f5..544dcfa 100644
--- a/Swift/ChangeLog.md
+++ b/Swift/ChangeLog.md
@@ -1,3 +1,7 @@
+2.1
+---
+- Fixed potential crash when using proxies on Mac OS X.
+
 2.0-beta2
 ---------
 - Enable auto-completion of nicknames that don't start with a letter.
diff --git a/Swiften/Network/MacOSXProxyProvider.cpp b/Swiften/Network/MacOSXProxyProvider.cpp
index eaadd28..00fb478 100644
--- a/Swiften/Network/MacOSXProxyProvider.cpp
+++ b/Swiften/Network/MacOSXProxyProvider.cpp
@@ -27,7 +27,6 @@ static HostAddressPort getFromDictionary(CFDictionaryRef dict, CFStringRef enabl
 		const int i = 0;
 		CFNumberRef zero = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &i);
 		CFComparisonResult result = CFNumberCompare(numberValue, zero, NULL);
-		CFRelease(numberValue);
 
 		if(result != kCFCompareEqualTo) {
 			int port = 0;
@@ -37,7 +36,6 @@ static HostAddressPort getFromDictionary(CFDictionaryRef dict, CFStringRef enabl
 				CFNumberRef numberValue = reinterpret_cast<CFNumberRef> (CFDictionaryGetValue(dict, portKey));
 				if(numberValue != NULL) {
 					CFNumberGetValue(numberValue, kCFNumberIntType, &port);
-					CFRelease(numberValue);
 				}
 
 				CFStringRef stringValue = reinterpret_cast<CFStringRef> (CFDictionaryGetValue(dict, hostKey));
@@ -52,7 +50,6 @@ static HostAddressPort getFromDictionary(CFDictionaryRef dict, CFStringRef enabl
 							host += *iter;
 						}
 					}
-					CFRelease(stringValue);
 				}
 			}
 			catch(...) {
-- 
cgit v0.10.2-6-g49f6