[sysprof] tests: fix leak in test



commit bfac3ab7628384e16b172f44ded8fc39c78cc1a1
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 27 18:02:15 2018 -0700

    tests: fix leak in test
    
    This allows the test to pass under ASAN.

 tests/test-model-filter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/tests/test-model-filter.c b/tests/test-model-filter.c
index bec0be3..fa17841 100644
--- a/tests/test-model-filter.c
+++ b/tests/test-model-filter.c
@@ -97,7 +97,10 @@ test_basic (void)
   sp_model_filter_set_filter_func (filter, filter_func2, NULL, NULL);
   g_assert_cmpint (500, ==, g_list_model_get_n_items (G_LIST_MODEL (filter)));
 
-  g_list_store_append (model, test_item_new (1001));
+  {
+    g_autoptr(TestItem) freeme = test_item_new (1001);
+    g_list_store_append (model, freeme);
+  }
 
   for (i = 0; i < 500; i++)
     g_list_store_remove (model, 0);


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