[librest/wip/teuf/gtask: 24/28] tests/xml: Fix various leaks



commit 01229f1a6790b7602cff81ef70f20b1e6794d042
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Jun 20 11:50:28 2016 +0200

    tests/xml: Fix various leaks
    
    This fixes:
    
    ==16342== 93 (64 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 211 of 278
    ==16342==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
    ==16342==    by 0x5F5CE58: g_malloc (gmem.c:94)
    ==16342==    by 0x5F73D42: g_slice_alloc (gslice.c:1025)
    ==16342==    by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
    ==16342==    by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
    ==16342==    by 0x56DAA42: soup_uri_new (soup-uri.c:519)
    ==16342==    by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
    ==16342==    by 0x4009E6: test_url_fragment_no_access_token (oauth2.c:36)
    ==16342==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16342==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16342==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16342==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16342==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16342==    by 0x400B64: main (oauth2.c:65)
    ==16342==
    ==16342== 133 (64 direct, 69 indirect) bytes in 1 blocks are definitely lost in loss record 262 of 278
    ==16342==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
    ==16342==    by 0x5F5CE58: g_malloc (gmem.c:94)
    ==16342==    by 0x5F73D42: g_slice_alloc (gslice.c:1025)
    ==16342==    by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
    ==16342==    by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
    ==16342==    by 0x56DAA42: soup_uri_new (soup-uri.c:519)
    ==16342==    by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
    ==16342==    by 0x400A25: test_access_token_simple (oauth2.c:44)
    ==16342==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16342==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16342==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16342==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16342==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16342==    by 0x400B64: main (oauth2.c:65)
    ==16342==
    ==16342== 137 (64 direct, 73 indirect) bytes in 1 blocks are definitely lost in loss record 263 of 278
    ==16342==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
    ==16342==    by 0x5F5CE58: g_malloc (gmem.c:94)
    ==16342==    by 0x5F73D42: g_slice_alloc (gslice.c:1025)
    ==16342==    by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
    ==16342==    by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
    ==16342==    by 0x56DAA42: soup_uri_new (soup-uri.c:519)
    ==16342==    by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
    ==16342==    by 0x400A97: test_url_encoding_access_token (oauth2.c:51)
    ==16342==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16342==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16342==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16342==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16342==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16342==    by 0x400B64: main (oauth2.c:65)

 tests/xml.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tests/xml.c b/tests/xml.c
index 1ee16e1..4b7718b 100644
--- a/tests/xml.c
+++ b/tests/xml.c
@@ -49,6 +49,7 @@ main (int argc, char **argv)
                TEST_XML, xml);
     }
 
+  g_free (xml);
   rest_xml_node_unref (root);
 
   root = rest_xml_node_add_child (NULL, "node0");
@@ -75,7 +76,9 @@ main (int argc, char **argv)
                TEST_XML, xml);
     }
 
+  g_free (xml);
   rest_xml_node_unref (root);
+  g_object_unref (parser);
 
   return 0;
 }


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