Fixing early return memory leak.