Memory leaks in GnomeVFS



Hi,

I think I've found a couple more memory leaks in gnomevfs, a patch is
below.


Cheers,
  James "Doc" Livingston


Index: libgnomevfs/gnome-vfs-daemon-method.c
===================================================================
--- libgnomevfs/gnome-vfs-daemon-method.c       (revision 5416)
+++ libgnomevfs/gnome-vfs-daemon-method.c       (working copy)
@@ -1262,6 +1262,7 @@ do_read_directory (GnomeVFSMethod       
                 * next call.
                 */
                if (!handle->current) {
+                       gnome_vfs_file_info_list_free (handle->dirs);
                        handle->dirs = NULL;
                }
        } else {
Index: libgnomevfs/gnome-vfs-monitor.c
===================================================================
--- libgnomevfs/gnome-vfs-monitor.c     (revision 5416)
+++ libgnomevfs/gnome-vfs-monitor.c     (working copy)
@@ -117,6 +117,8 @@ _gnome_vfs_monitor_do_add (GnomeVFSMetho
 
        if (result != GNOME_VFS_OK) {
                gnome_vfs_uri_unref (uri);
+               g_queue_foreach (handle->pending_callbacks, (GFunc)
free_callback_data, NULL);
+               g_queue_free (monitor_handle->pending_callbacks);
                g_free (monitor_handle);
                monitor_handle = NULL;
        } else {




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