Q:

Analyzer issue: Potential leak of an object allocated on line 25 and stored into 'oneCopy'

I've upgraded Xcode and have been presented with tons of analyzer warnings like this:

Potential leak of an object allocated on line 25 and stored into 'oneCopy'

Can anyone point me in the right direction?
@implementation NSDictionary(DeepMutableCopy)
-(NSMutableDictionary *)mutableDeepCopy
{
    NSMutableDictionary *ret = [[NSMutableDictionary alloc] initWithCapacity:[self count]];
    NSArray *keys = [self allKeys];
    for (id key in keys)
    {
        id oneValue = [self valueForKey:key];
        id oneCopy = nil;

        if ([oneValue respondsToSelector:@selector(mutableDeepCopy)])
            oneCopy = [oneValue mutableDeepCopy];
        else if ([oneValue respondsToSelector:@selector(mutableCopy)])
            oneCopy = [oneValue mutableCopy];
        if (oneCopy == nil)
            oneCopy = [oneValue copy];
        [ret setValue:oneCopy forKey:key];
    }
    return ret;
}
@end

Screenshot showing lines numbers:

#import "NSDictionary-DeepMutableCopy.h"

@implementation NSDictionary(DeepMutableCopy)
-(NSMutableDictionary *)mutableDeepCopy
{
    //NSMutableDictionary *ret = [[NSMutableDictionary alloc] initWithCapacity:[self count]];
    NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:[self count]];
    NSArray *keys = [self allKeys];
    for (id key in keys)
    {
        id oneValue = [self valueForKey:key];
        id oneCopy = nil;

        if ([oneValue respondsToSelector:@selector(mutableDeepCopy)])
            oneCopy = [oneValue mutableDeepCopy];
        else if ([oneValue respondsToSelector:@selector(mutableCopy)])
            oneCopy = [oneValue mutableCopy];
        if (oneCopy == nil)
            oneCopy = [oneValue copy];
        [ret setValue:oneCopy forKey:key];
        [oneCopy release];
    }
    return ret;

}
@end

A:

Addressing your second issue first, instead of [[NSMutableDictionary alloc] initWithCapacity:[self count]] you could use [NSMutableDictionary dictionaryWithCapacity:[self count]] which will return an autoreleased object and you will have to retain it yourself in the calling code.
On the other hand, you could rename your method to start with the word copy if you want it to return a retained object and not throw errors - which I think is exactly what you want to do in this case. The rest of my response assumes you have taken this path.
My original answer was as follows: You are not releasing oneCopy at the end of each iteration. Try adding [oneCopy release]; right after [ret setValue:oneCopy forKey:key];.
However, as Alexsander Akers points out the compiler thinks that -mutableDeepCopy has a 0 refcount. So, if you rename as suggested above and include [oneCopy release] as I originally suggested it should take care of both issues. If it doesn't, definitely check out some of the other solutions in the question he referenced.
Example:
@implementation NSDictionary(DeepMutableCopy)
-(NSMutableDictionary *)copyWithDeepCopiedValues
{
    NSMutableDictionary *ret = [[NSMutableDictionary alloc] initWithCapacity:[self count]];

    NSArray *keys = [self allKeys];
    for (id key in keys)
    {
        id oneValue = [self valueForKey:key];
        id oneCopy = nil;

        if ([oneValue respondsToSelector:@selector(mutableDeepCopy)])
            oneCopy = [oneValue copyWithDeepCopiedValues];
        else if ([oneValue respondsToSelector:@selector(mutableCopy)])
            oneCopy = [oneValue mutableCopy];
        if (oneCopy == nil)
            oneCopy = [oneValue copy];
        [ret setObject:oneCopy forKey:key];

        [oneCopy release];
    }

    return ret;
}
@end

