Fixed leaks of copied CF objects

This commit is contained in:
Minh Nguyễn
2015-05-05 12:10:44 -04:00
parent fc576ddef6
commit ec3757309f

View File

@@ -617,10 +617,11 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
NSString *ssid = nil;
CFArrayRef interfaces = CNCopySupportedInterfaces();
if (interfaces) {
NSDictionary *info = (__bridge NSDictionary *)CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0));
NSDictionary *info = CFBridgingRelease(CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0)));
if (info) {
ssid = info[@"SSID"];
}
CFRelease(interfaces);
}
return ssid;