Further to this question I've fixed a bunch of memory leaks in BEncoding.m (originally from here)
I've fixed all the obvious memory leaks, but Clang has found four "Leak of returned object" bugs, which I'm not sure how to sort:
The full messages/appropriate bits of code are:
NSMutableData *data = [[NSMutableData alloc] init];
[1] Method returns an Objective-C object with a +1 retain count (owning reference)
[...] snprintf(buffer, 32, "%lu:", [object length]); [data appendBytes:buffer length:strlen(buffer)]; [data appendData:object]; return data;
[3] Object returned to caller as an owning reference (single retain count transferred to caller)