[cfe-dev] Silencing an analyzer warning

Joe Ranieri joe at alacatialabs.com
Thu Apr 29 05:08:23 PDT 2010

CURL *handle = curl_easy_init();
RequestInfo *result = [[[RequestInfo alloc] init] autorelease];

// Keep a pointer to this object around so that curl can give it back to 
us in callbacks
curl_easy_setopt(handle, CURLOPT_PRIVATE, CFRetain(result)));

The static analyzer tells us that result is leaked (which, without it 
knowing about curl, it does look like). However, it's not actually being 
leaked and gets cleaned up later when we clean up the CURL handle. Is 
there any way to silence this analyzer warning? We'd like to get our 
project analyzer-warning free and require no warnings before committing 

-- Joe Ranieri

More information about the cfe-dev mailing list