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



commit defc6ad2e4fbeb4edfca70b7316638b572c3bccd
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

 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]