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



commit f79a96b772a660a8c2095730842f0eb9132024fc
Author: lisastjohn <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]