[gnome-system-monitor] Fix memory leak in process_visibility_func()



commit b1c5f39316d7907bdb0fa2066b74724c47526f02
Author: Eric R. Schulz <eric ers35 com>
Date:   Thu Aug 18 16:58:21 2016 -0400

    Fix memory leak in process_visibility_func()
    
    tree_path was being leaked for every call of process_visibility_func().
    This bug was introduced in 65712f7
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770116

 src/proctable.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/proctable.cpp b/src/proctable.cpp
index ee3d6df..3f34633 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -247,8 +247,10 @@ process_visibility_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
     const gchar * search_text = app->search_entry == NULL ? "" : gtk_entry_get_text (GTK_ENTRY 
(app->search_entry));
     GtkTreePath *tree_path = gtk_tree_model_get_path (model, iter);
 
-    if (strcmp (search_text, "") == 0)
+    if (strcmp (search_text, "") == 0) {
+        gtk_tree_path_free (tree_path);
         return TRUE;
+    }
 
        // in case we are in dependencies view, we show (and expand) rows not matching the text, but having a 
matching child
     gboolean match = false;


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