[gtk/fix-memleaks: 1/3] tests: Plug memory leaks




commit dda69bd16d170e1e80cb702a3df9ab315de392f9
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 27 19:56:36 2021 -0400

    tests: Plug memory leaks
    
    This one was pointed out by asan.

 testsuite/gdk/pixbuf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/gdk/pixbuf.c b/testsuite/gdk/pixbuf.c
index 592f5d0d32..8e34254074 100644
--- a/testsuite/gdk/pixbuf.c
+++ b/testsuite/gdk/pixbuf.c
@@ -14,7 +14,7 @@ main (int argc, char *argv[])
   for (GSList *l = formats; l; l = l->next)
     {
       GdkPixbufFormat *format = l->data;
-      const char *name;
+      char *name;
 
       name = gdk_pixbuf_format_get_name (format);
 
@@ -22,6 +22,8 @@ main (int argc, char *argv[])
         have_png = TRUE;
       else if (strcmp (name, "jpeg") == 0)
         have_jpeg = TRUE;
+
+      g_free (name);
     }
 
   if (!have_png || !have_jpeg)


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