[nautilus] files-view: Fix memory leak



commit cfee568ffb688701c93caa81f841eb938522eae4
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Tue May 2 19:12:56 2017 +0530

    files-view: Fix memory leak
    
    nautilus_file_get_mime_type() returns a newly
    allocated string, which should be freed when no longer
    required.
    
    using g_autofree() automatically frees the string fixing the leak
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782070

 src/nautilus-files-view.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 07b4037..b6974db 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1449,7 +1449,7 @@ choose_program (NautilusFilesView *view,
                 GList             *files)
 {
     GtkWidget *dialog;
-    gchar *mime_type;
+    g_autofree gchar *mime_type = NULL;
     GtkWindow *parent_window;
 
     g_assert (NAUTILUS_IS_FILES_VIEW (view));


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