title: OpenCV - cvExtractSURF is causing a memory leak?
body: <p>I am using the OpenCV function: <code>cvExtractSURF</code> but I am finding a major memory leak. Has anyone successfully implemented this call? </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>IplImage *cvImage = [self CreateIplImageFromUIImage:image grayscale:YES];
  
  CvMemStorage* storage = cvCreateMemStorage(0);
  
  CvSeq *objectKeypoints = 0;
  //CvSeq *objectDescriptors = 0;
  
  CvSURFParams params = cvSURFParams(self.hessianThreshold, 0);
  double tt = (double)cvGetTickCount();
  
  //Extract the features
  cvExtractSURF( cvImage, 0, &amp;objectKeypoints, NULL, storage, params, 0);
  
  tt = (double)cvGetTickCount() - tt;
  //NSLog(@"%d features found in %gms seconds\n", objectKeypoints-&gt;total, tt/(cvGetTickFrequency()*1000.));
  
  cvReleaseImage(&amp;cvImage);
  cvReleaseMemStorage(&amp;storage);
  </code></pre>
  
  <p>Any ideas where this could be leaking? When I comment out the line:</p>
  
  <pre><code>cvExtractSURF( cvImage, 0, &amp;objectKeypoints, NULL, storage, params, 0);
  </code></pre>
  
  <p>no leak occurs.</p>