[glib] Plug a mem leak in GConverterOutputStream



commit 08924ad1472a17cd6c144ae25a350af0b2d9afe7
Author: Christian Persch <chpe gnome org>
Date:   Mon Aug 30 10:18:30 2010 -0400

    Plug a mem leak in GConverterOutputStream
    
    ==8221== 1,047 (672 direct, 375 indirect) bytes in 28 blocks are definitely lost in loss record 589 of 603
    ==8221==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==8221==    by 0x4057094: g_malloc (gmem.c:134)
    ==8221==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
    ==8221==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
    ==8221==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
    ==8221==    by 0x403AC31: g_set_error_literal (gerror.c:314)
    ==8221==    by 0x80499DC: g_compressor_converter_convert (converter-stream.c:267)
    ==8221==    by 0x417BF67: g_converter_convert (gconverter.c:174)
    ==8221==    by 0x417D7F0: g_converter_output_stream_write (gconverteroutputstream.c:428)
    ==8221==    by 0x41B57DF: g_output_stream_write (goutputstream.c:216)
    ==8221==    by 0x804A367: test_compressor (converter-stream.c:456)
    
    Bug #628309.

 gio/gconverteroutputstream.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gio/gconverteroutputstream.c b/gio/gconverteroutputstream.c
index 52b8da1..8c9b0b0 100644
--- a/gio/gconverteroutputstream.c
+++ b/gio/gconverteroutputstream.c
@@ -477,6 +477,7 @@ g_converter_output_stream_write (GOutputStream *stream,
 		buffer_append (&priv->output_buffer, buffer, count);
 	      /* in the converting_from_buffer case we already appended this */
 
+              g_error_free (my_error);
 	      return count; /* consume everything */
 	    }
 



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