Fix a leak in an error path
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 16 Feb 2007 05:32:59 +0000 (05:32 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 16 Feb 2007 05:32:59 +0000 (05:32 +0000)
svn path=/trunk/; revision=17306

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-png.c

index 94415d916f82ce0649a4244b8071f18898a6b4c2..69dcadaa23b7d6b769df2139e8bfdbd492fbbb9c 100644 (file)
@@ -1,3 +1,7 @@
+2007-02-16  Matthias Clasen  <mclasen@redhat.com>
+
+       * io-png.c: Don't leak in the error path.  (#405539, Daniel Atallah)
+
 2007-02-07  Chris Wilson  <chris@chris-wilson.co.uk>
 
        * io-jpeg.c: (gdk_pixbuf__jpeg_image_load),
index 2c98d63c4a5e8423b9f1863d4e2871f399ff712d..13a4c66e69dd94cbd41e18895a92cfdd4da2c04e 100644 (file)
@@ -917,8 +917,10 @@ static gboolean real_save_png (GdkPixbuf        *pixbuf,
                                           error,
                                           png_simple_error_callback,
                                           png_simple_warning_callback);
-
-       g_return_val_if_fail (png_ptr != NULL, FALSE);
+       if (png_ptr == NULL) {
+              success = FALSE;
+              goto cleanup;
+       }
 
        info_ptr = png_create_info_struct (png_ptr);
        if (info_ptr == NULL) {