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.
This commit is contained in:
Christian Persch 2010-09-03 15:44:28 -04:00 committed by Matthias Clasen
parent 94102a40f7
commit 31b15451cf

View File

@ -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);