[gtk/gtk-4-4] contentdeserializer: Plug a small memleak
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-4] contentdeserializer: Plug a small memleak
- Date: Sun, 31 Oct 2021 21:52:14 +0000 (UTC)
commit c12d398fa20c5341d36abd7470bfd1da48a1d589
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 f245b4c350..88ddb8ff50 100644
--- a/gdk/gdkcontentdeserializer.c
+++ b/gdk/gdkcontentdeserializer.c
@@ -928,11 +928,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]