title: UIImageWriteToSavedPhotosAlbum with malloc_error
body: <p>I have an NIB file with a button. When I click this button, the setWallpaper: selector is called. Everything works as expected (the image is saved), excepte by the error thrown by malloc.</p>
  
  <pre><code>malloc: *** error for object 0x184d000: pointer being freed was not allocated ***
  set a breakpoint in malloc_error_break to debug
  </code></pre>
  
  <p>I've set a breakpoint at malloc_error_break, but I don't understand anything from the debugger. I couldn't even find the object 0x184d000. Does anyone know why is this happening? I had also tried to retain the UIImage before sending it to UIImageWriteToSavedPhotosAlbum, but without success.</p>
  
  <p>My code is below:</p>
  
  <pre><code>- (IBAction)setWallpaper:(id)sender {
      UIImage *image = [UIImage imageNamed:@"wallpaper_01.png"];
      UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
  }
  
  - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
      UIAlertView *alertView = [[UIAlertView alloc] 
            initWithTitle:NSLocalizedString(@"Galo!!!",@"Saved image message: title")
                  message:NSLocalizedString(@"Now, check your \"saved photos\" group at \"photos\" app in your iPhone and select the actions menu &gt; set as wallpaper.",@"Saved image message")
                 delegate:nil
        cancelButtonTitle:NSLocalizedString(@"OK",@"OK Button")
        otherButtonTitles:nil];
     [alertView show];
     [alertView release];
  }
  </code></pre>