[glib] Plug a mem leak in readwrite test



commit 31b15451cf657499c15c1d08ccee0062a3486a9f
Author: Christian Persch <chpe gnome org>
Date:   Fri Sep 3 15:44:28 2010 -0400

    Plug a mem leak in readwrite test
    
    ==10395== 80 (24 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 529 of 561
    ==10395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==10395==    by 0x4057094: g_malloc (gmem.c:134)
    ==10395==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
    ==10395==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
    ==10395==    by 0x403A751: g_error_new_valist (gerror.c:54)
    ==10395==    by 0x403AAD4: g_set_error (gerror.c:240)
    ==10395==    by 0x4230328: _g_local_file_output_stream_create (glocalfileoutputstream.c:628)
    ==10395==    by 0x4227A04: g_local_file_create_readwrite (glocalfile.c:1388)
    ==10395==    by 0x418974C: g_file_create_readwrite (gfile.c:1784)
    ==10395==    by 0x8049FCD: test_g_file_create_readwrite (readwrite.c:187)
    
    Bug #628331.

 gio/tests/readwrite.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/readwrite.c b/gio/tests/readwrite.c
index 5113186..7836270 100644
--- a/gio/tests/readwrite.c
+++ b/gio/tests/readwrite.c
@@ -186,7 +186,8 @@ test_g_file_create_readwrite (void)
   error = NULL;
   file_iostream = g_file_create_readwrite (file, 0, NULL, &error);
   g_assert (file_iostream == NULL);
-  g_assert (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS));
+  g_assert_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS);
+  g_error_free (error);
 
   g_unlink (tmp_file);
   file_iostream = g_file_create_readwrite (file, 0, NULL, &error);



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