Plug a mem leak in the memory-input-stream test
authorChristian Persch <chpe@gnome.org>
Fri, 3 Sep 2010 19:30:47 +0000 (15:30 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 3 Sep 2010 19:30:47 +0000 (15:30 -0400)
==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2389==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2389==    by 0x41AFD15: g_memory_input_stream_truncate (gmemoryinputstream.c:517)
==2389==    by 0x41BAC0F: g_seekable_truncate (gseekable.c:174)
==2389==    by 0x8049595: test_truncate (memory-input-stream.c:123)

Bug #628331.

gio/tests/memory-input-stream.c

index 3bb021c..a111d7a 100644 (file)
@@ -122,6 +122,7 @@ test_truncate (void)
   error = NULL;
   g_assert (!g_seekable_truncate (G_SEEKABLE (stream), 26, NULL, &error));
   g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED);
+  g_error_free (error);
 
   g_object_unref (stream);
 }