GNOME Bugzilla – Bug 165312
Leak in font-method.c
Last modified: 2005-02-02 11:17:22 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);
Good catch. Go ahead and apply the fix.
Commited to both branches.