[librsvg] Plug a mem leak



commit a3c9aaa77fadd8a56aec314563a1357eac296d91
Author: Christian Persch <chpe gnome org>
Date:   Mon Jan 30 20:26:23 2012 +0100

    Plug a mem leak
    
    Don't leak the GFile.
    
    ==2493== 46 (16 direct, 30 indirect) bytes in 1 blocks are definitely lost in loss record 579 of 921
    ==2493==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==2493==    by 0x45772DA: standard_malloc (gmem.c:85)
    ==2493==    by 0x4577680: g_malloc (gmem.c:159)
    ==2493==    by 0x458B29D: g_slice_alloc (gslice.c:1003)
    ==2493==    by 0x458B805: g_slice_alloc0 (gslice.c:1029)
    ==2493==    by 0x426DBA7: g_type_create_instance (gtype.c:1872)
    ==2493==    by 0x4250717: g_object_constructor (gobject.c:1839)
    ==2493==    by 0x4252488: g_object_newv (gobject.c:1622)
    ==2493==    by 0x4252A17: g_object_new (gobject.c:1532)
    ==2493==    by 0x4176D3A: _g_local_file_new (glocalfile.c:288)
    ==2493==    by 0x417EA84: g_local_vfs_get_file_for_uri (glocalvfs.c:110)
    ==2493==    by 0x410E8DB: g_vfs_get_file_for_uri (gvfs.c:130)
    ==2493==    by 0x40C93DE: g_file_new_for_uri (gfile.c:5893)
    ==2493==    by 0x403A59F: _rsvg_io_acquire_data (rsvg-io.c:265)

 rsvg-io.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-io.c b/rsvg-io.c
index 2cf0cdb..f026c3d 100644
--- a/rsvg-io.c
+++ b/rsvg-io.c
@@ -270,6 +270,7 @@ rsvg_acquire_gvfs_data (const char *uri,
         g_error_matches (err, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
         base_uri != NULL) {
         g_clear_error (&err);
+        g_object_unref (file);
 
         base = g_file_new_for_uri (base_uri);
         file = g_file_resolve_relative_path (base, uri);



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