[glib] gio: fix small memory leak on local xattr



commit d3c729bf0e3320046f309ce64b4ff0189563fe89
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Thu Jan 16 18:02:18 2014 +0100

    gio: fix small memory leak on local xattr
    
    g_strconcat() allocates memory, it needs to be freed.
    
    ==10653== 1,400 bytes in 50 blocks are definitely lost in loss record
    1,838 of 1,851
    ==10653==    at 0x4A0645D: malloc (in
    /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==10653==    by 0x54ACB22: g_malloc (gmem.c:102)
    ==10653==    by 0x54ACE4D: g_malloc_n (gmem.c:343)
    ==10653==    by 0x54C8463: g_strconcat (gstrfuncs.c:589)
    ==10653==    by 0x4D6ED38: get_xattrs_from_fd (glocalfileinfo.c:660)
    ==10653==    by 0x4D71622:
    _g_local_file_info_get_from_fd (glocalfileinfo.c:2028)
    ==10653==    by 0x4D731A0:
    g_local_file_input_stream_query_info (glocalfileinputstream.c:356)
    ==10653==    by 0x4C996D8:
    g_file_input_stream_query_info (gfileinputstream.c:148)
    ==10653==    by 0x4C863F6: file_copy_fallback (gfile.c:3120)
    ==10653==    by 0x4C86DD2: g_file_copy (gfile.c:3398)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722357

 gio/glocalfileinfo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index 4f6d5a2..ff707b7 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -664,6 +664,7 @@ get_xattrs_from_fd (int                    fd,
                g_free (escaped_attr);
              
              get_one_xattr_from_fd (fd, info, gio_attr, attr);
+             g_free (gio_attr);
            }
          
          len = strlen (attr) + 1;


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