[grilo] test-ui: Fix several leaks



commit 2b2c5cf6aa46a73ff383e4eafe33760eb109b776
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Sep 18 11:07:14 2017 +0200

    test-ui: Fix several leaks
    
    Fixing these leaks makes it easier to spot leaks coming from the
    underlying libraries when running under valgrind.
    
    Signed-off-by: Christophe Fergeau <cfergeau redhat com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787873

 tools/grilo-test-ui/main.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 0caa7ab..eaa8a72 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -542,8 +542,9 @@ composed_value_description (GList *values)
   GString *composed = g_string_new ("");
 
   while (values) {
-    composed = g_string_append (composed,
-                                value_description ((GValue *) values->data));
+    char *desc = value_description ((GValue *) values->data);
+    g_string_append (composed, desc);
+    g_free (desc);
     if (--length > 0) {
       composed = g_string_append (composed, ", ");
     }
@@ -609,6 +610,7 @@ resolve_cb (GrlSource *source,
                             METADATA_MODEL_VALUE, composed_value,
                             -1);
         GRL_DEBUG ("  %s: %s", key_name, composed_value);
+        g_free (composed_value);
       }
       i = g_list_next (i);
     }
@@ -1069,6 +1071,7 @@ browser_row_selected_cb (GtkTreeView *tree_view,
     gtk_widget_set_sensitive (view->remove_btn, FALSE);
   }
 
+  gtk_tree_path_free(path);
   g_object_unref (source);
   g_clear_object (&content);
 }


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