[gdk-pixbuf/wip/rishi/png: 2/3] io-png: Remove redundant NULL check



commit f7592463ab63326e3f0d2af7f6aff105f91d7ce0
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Sep 8 16:22:48 2018 +0200

    io-png: Remove redundant NULL check
    
    png_destroy_read_struct is safe against both a NULL png_infop and
    pointer to a NULL png_infop.
    
    Fallout from e8d0d8ed3d33ee6cedb75a394c36af3312b310ff
    
    https://gitlab.gnome.org/GNOME/gdk-pixbuf/merge_requests/16

 gdk-pixbuf/io-png.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c
index b7f27e24a..06cf36595 100644
--- a/gdk-pixbuf/io-png.c
+++ b/gdk-pixbuf/io-png.c
@@ -488,8 +488,7 @@ gdk_pixbuf__png_image_begin_load (GdkPixbufModuleSizeFunc size_func,
         }
         
        if (setjmp (png_jmpbuf(lc->png_read_ptr))) {
-               if (lc->png_info_ptr)
-                       png_destroy_read_struct(&lc->png_read_ptr, &lc->png_info_ptr, NULL);
+                png_destroy_read_struct(&lc->png_read_ptr, &lc->png_info_ptr, NULL);
                 g_free(lc);
                 /* error callback should have set the error */
                 return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]