gvfs r1687 - in trunk: . daemon



Author: pborelli
Date: Fri Mar 28 08:59:11 2008
New Revision: 1687
URL: http://svn.gnome.org/viewvc/gvfs?rev=1687&view=rev

Log:
2008-03-28  Paolo Borelli  <pborelli katamail com>

	* daemon/gvfsbackendtrash.c: plug some minor memory leaks.


Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendtrash.c

Modified: trunk/daemon/gvfsbackendtrash.c
==============================================================================
--- trunk/daemon/gvfsbackendtrash.c	(original)
+++ trunk/daemon/gvfsbackendtrash.c	Fri Mar 28 08:59:11 2008
@@ -573,6 +573,10 @@
         has_trash_files = TRUE;
     }
 
+  g_list_foreach (topdirs, (GFunc) g_free, NULL);
+  g_list_free (topdirs);
+  g_list_free (topdirs_info);
+
   return g_list_reverse (dirs);
 }
 
@@ -1007,9 +1011,6 @@
 { 
   GFile *file, *files_file;
   GFileEnumerator *enumerator;
-  GFileInfo *info;
-  const char *name;
-  char *new_name, *new_name_escaped;
   char *info_dir;
 
   info_dir = g_build_filename (trashdir, "info", NULL);
@@ -1027,10 +1028,15 @@
 
   if (enumerator)
     {
+      GFileInfo *info;
+
       while ((info = g_file_enumerator_next_file (enumerator,
                                                   job ? G_VFS_JOB (job)->cancellable : NULL,
                                                   NULL)) != NULL)
         {
+          const char *name;
+          char *new_name, *new_name_escaped;
+
           name = g_file_info_get_name (info);
 
           /* Get the display name, etc */
@@ -1058,6 +1064,8 @@
                                NULL);
       g_object_unref (enumerator);
     }
+
+  g_free (info_dir);
 }
 
 static GList *



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