[gnome-photos/wip/rishi/use-g-auto-00: 1/3] operation-png-guess-sizes: Use g_auto*




commit 8ef22dbbe285e9e9fc4cbf8971963a3477dbf7dc
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Mar 27 15:16:56 2021 +0100

    operation-png-guess-sizes: Use g_auto*
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/77

 src/photos-operation-png-guess-sizes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/photos-operation-png-guess-sizes.c b/src/photos-operation-png-guess-sizes.c
index 7e0818fb..0ae0fe9f 100644
--- a/src/photos-operation-png-guess-sizes.c
+++ b/src/photos-operation-png-guess-sizes.c
@@ -71,7 +71,7 @@ photos_operation_png_guess_sizes_count (GeglBuffer *buffer,
   const Babl *format_buffer;
   gsize ret_val = 0;
   gsize size;
-  guchar *pixels = NULL;
+  g_autofree guchar *pixels = NULL;
   png_infop info_ptr = NULL;
   png_structp png_ptr = NULL;
 
@@ -182,7 +182,6 @@ photos_operation_png_guess_sizes_count (GeglBuffer *buffer,
   ret_val = size;
 
  out:
-  g_free (pixels);
   png_destroy_write_struct (&png_ptr, &info_ptr);
   return ret_val;
 }


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