From 5674a9b3410f1ef6cf6d7be23d3aeb4b496e507d Mon Sep 17 00:00:00 2001 From: David Beck Date: Mon, 14 Mar 2016 11:28:26 -0700 Subject: [PATCH] Fixed analyzer warnings This fixes a warning produced by the static analyzer. --- Pod/Classes/Internal/SEGReachability.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Pod/Classes/Internal/SEGReachability.m b/Pod/Classes/Internal/SEGReachability.m index 2b79689bc..12d0a16eb 100644 --- a/Pod/Classes/Internal/SEGReachability.m +++ b/Pod/Classes/Internal/SEGReachability.m @@ -113,6 +113,7 @@ + (SEGReachability *)reachabilityWithHostname:(NSString *)hostname SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); if (ref) { id reachability = [[self alloc] initWithReachabilityRef:ref]; + CFRelease(ref); #if __has_feature(objc_arc) return reachability; @@ -129,6 +130,7 @@ + (SEGReachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAdd SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostAddress); if (ref) { id reachability = [[self alloc] initWithReachabilityRef:ref]; + CFRelease(ref); #if __has_feature(objc_arc) return reachability; @@ -171,6 +173,7 @@ - (SEGReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref if (self != nil) { self.reachableOnWWAN = YES; self.reachabilityRef = ref; + CFRetain(self.reachabilityRef); } return self;