Hi Stackoverflow,
I know this might be not correct at all, but I'm currently getting memory leaks in Instruments while using CFReadStreamRead and CFReadStreamOpen. The code looks like this:
UInt8* streambuffer = malloc(kReadStreamBufferSize);
int readBytes = CFReadStreamRead(httpReadStream,streambuffer,kReadStreamBufferSize);
...
free(streambuffer);
...
CFRelease(httpReadStream);
httpReadStream = nil;
I know it's very unlikely that there is a memory error in CFReadStreamRead. At least Instruments (running against iOS 4.1 on my iPhone3G) tells me so. You can find a screenshot from Instruments here: http://dl.dropbox.com/u/381491/LeaksInInstruments.png
Cheers Chris