title: ios thwarting a potential memory leak
body: <pre><code>- (NSString*)encodeURL:(NSString *)string
  {
      NSString *newString = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &amp;'()*+,;=\"&lt;&gt;%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
  
      if (newString) 
      {
          return newString; // &lt;-- potential leak here
      }
  
      return @"";
  }
  </code></pre>
  
  <p>I'm not familiar with CFTypes (other than knowing what they are). This is code I got from the internet and have had to finagle a bit to get it to work in ARC. I'm getting a potential leak warning and I'm not sure how to fix it. Suggestions?</p>