[gnome-photos/wip/rishi/Grimthorpe-first-patch: 2/3] debug: Use g_auto*



commit 5f4fe09be5e1250b1812bfe0e275b4e78a348ba4
Author: Lisa St.John <gnome grimthorpe org>
Date:   Sun Feb 3 12:25:41 2019 +0000

    debug: Use g_auto*
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/77

 src/photos-debug.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/photos-debug.c b/src/photos-debug.c
index 48d9e881..2cb29c78 100644
--- a/src/photos-debug.c
+++ b/src/photos-debug.c
@@ -55,7 +55,7 @@ void photos_debug (guint flags, const char *fmt, ...)
 {
   if ((debug_flags & flags) != 0)
     {
-      gchar *message;
+      g_autofree gchar *message = NULL;
       va_list ap;
 
       va_start (ap, fmt);
@@ -63,7 +63,5 @@ void photos_debug (guint flags, const char *fmt, ...)
       va_end (ap);
 
       g_debug ("%s", message);
-
-      g_free (message);
     }
 }


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