After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 165312 - Leak in font-method.c
Leak in font-method.c
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] fonts:///
2.9.x
Other Linux
: Normal normal
: ---
Assigned To: James Henstridge
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-01-26 15:02 UTC by Kjartan Maraas
Modified: 2005-02-02 11:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Kjartan Maraas 2005-01-26 15:02:27 UTC
Valgrind reports this leak in the font-method:

=5811== 45075 bytes in 872 blocks are definitely lost in loss record 176 of 186
==5811==    at 0x1B904278: malloc (vg_replace_malloc.c:130)
==5811==    by 0x1C3FEA09: IA__g_malloc (gmem.c:137)
==5811==    by 0x1C40DB54: IA__g_strconcat (gstrfuncs.c:228)
==5811==    by 0x1C07992C: gnome_vfs_get_uri_from_local_path (gnome-vfs-utils.c:752)
==5811==    by 0x1DC166DC: fill_file_info (font-method.c:251)
==5811==    by 0x1DC1681D: do_read_directory (font-method.c:367)
==5811==    by 0x1C060796: gnome_vfs_directory_read_next_cancellable
(gnome-vfs-directory.c:225)
==5811==    by 0x1C067F23: _gnome_vfs_job_execute (gnome-vfs-job.c:1468)
==5811==    by 0x1C066487: thread_routine (gnome-vfs-job-slave.c:64)
==5811==    by 0x1C0763C7: thread_entry (gnome-vfs-thread-pool.c:186)
==5811==    by 0x1C411CC3: g_thread_create_proxy (gthread.c:561)
==5811==    by 0xDE23AD: start_thread (in /lib/tls/libpthread-2.3.4.so)
==5811==    by 0xC61B6D: clone (in /lib/tls/libc-2.3.4.so)

I think this is the right patch:

diff -u -p -r1.8 font-method.c
--- font-method.c       25 Dec 2004 14:37:33 -0000      1.8
+++ font-method.c       26 Jan 2005 15:01:04 -0000
@@ -250,6 +250,7 @@ fill_file_info(GnomeVFSFileInfo *file_in

     uri = gnome_vfs_get_uri_from_local_path(file);
     result = gnome_vfs_get_file_info(uri, file_info, options);
+    g_free (uri);
     if (result == GNOME_VFS_OK) {
        g_free(file_info->name);
        file_info->name = g_strdup(name);
Comment 1 James Henstridge 2005-02-02 10:44:15 UTC
Good catch.  Go ahead and apply the fix.
Comment 2 Kjartan Maraas 2005-02-02 11:17:10 UTC
Commited to both branches.