[gtk/matthiasc/for-master] contentdeserializer: Plug a small memleak




commit b8622adac57d6397d1f592f3b6e82287709d3c09
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 3 14:51:03 2021 -0400

    contentdeserializer: Plug a small memleak
    
    Found by asan in ci. We intern the mimetypes
    when they are registered, so there is no need
    to leak this string.

 gdk/gdkcontentdeserializer.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c
index 56a62f7ae3..9ab3482c6f 100644
--- a/gdk/gdkcontentdeserializer.c
+++ b/gdk/gdkcontentdeserializer.c
@@ -1008,11 +1008,13 @@ init (void)
   if (!g_get_charset (&charset))
     {
       char *mime = g_strdup_printf ("text/plain;charset=%s", charset);
+
       gdk_content_register_deserializer (mime,
                                          G_TYPE_STRING,
                                          string_deserializer,
                                          (gpointer) charset,
                                          g_free);
+      g_free (mime);
     }
   gdk_content_register_deserializer ("text/plain",
                                      G_TYPE_STRING,


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