[glib] Plug a mem leak in converter-stream test



commit 85179745ac72280746da101a5232f7843f2426d3
Author: Christian Persch <chpe gnome org>
Date:   Fri Sep 3 15:39:07 2010 -0400

    Plug a mem leak in converter-stream test
    
    ==2396== 66 (24 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 565 of 625
    ==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==2396==    by 0x4057094: g_malloc (gmem.c:134)
    ==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
    ==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
    ==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
    ==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
    ==2396==    by 0x417BA38: g_charset_converter_convert (gcharsetconverter.c:344)
    ==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
    ==2396==    by 0x417C9EB: g_converter_input_stream_read (gconverterinputstream.c:403)
    ==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
    ==2396==    by 0x41A7B43: g_input_stream_read_all (ginputstream.c:256)
    ==2396==    by 0x804B0E4: test_charset (converter-stream.c:682)
    
    Bug #628331.

 gio/tests/converter-stream.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c
index 6e7fde1..4a21cd1 100644
--- a/gio/tests/converter-stream.c
+++ b/gio/tests/converter-stream.c
@@ -688,7 +688,10 @@ test_charset (gconstpointer data)
       g_assert_cmpstr (buffer, ==, test->text_out);
     }
   else
-    g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA);
+    {
+      g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA);
+      g_error_free (error);
+    }
 
   g_free (buffer);
   g_object_unref (in2);



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