[mutter] clipboard-manager: Plug mimetypes list leak



commit 05301d280cc1233a4ea1508971eb09fdc9de5122
Author: Sebastian Keller <skeller src gnome org>
Date:   Sat Jan 11 03:29:29 2020 +0100

    clipboard-manager: Plug mimetypes list leak
    
    Fixes https://gitlab.gnome.org/GNOME/mutter/issues/1005
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1001

 src/core/meta-clipboard-manager.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/core/meta-clipboard-manager.c b/src/core/meta-clipboard-manager.c
index 1c1b587fe..ceb144469 100644
--- a/src/core/meta-clipboard-manager.c
+++ b/src/core/meta-clipboard-manager.c
@@ -122,13 +122,17 @@ owner_changed_cb (MetaSelection       *selection,
         }
 
       if (best_idx < 0)
-        return;
+        {
+          g_list_free_full (mimetypes, g_free);
+          return;
+        }
 
       display->saved_clipboard_mimetype = g_strdup (best);
+      g_list_free_full (mimetypes, g_free);
       output = g_memory_output_stream_new_resizable ();
       meta_selection_transfer_async (selection,
                                      META_SELECTION_CLIPBOARD,
-                                     best,
+                                     display->saved_clipboard_mimetype,
                                      transfer_size,
                                      output,
                                      NULL,


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