title: Memory Leaks when calling some CTFunctions in iPhone
body: <p>I write a function to calculate the end index of attributtedString in a rect,</p>
  
  <p>But it seems some memory leak,
  Please help me to fix it.</p>
  
  <pre><code>CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)attributtedString);
  
  CGMutablePathRef path = CGPathCreateMutable();
  CGPathAddRect(path, NULL, rect);
  
  CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(currentIndex, 0), path, NULL);
  
  CFRange frameRange = CTFrameGetVisibleStringRange(frame);
  endIndex += frameRange.length;
  
  CFRelease(frame);
  CFRelease(path);
  CFRelease(framesetter);
  </code></pre>
  
  <p>thanks in advance.</p>