[gvfs] Plug various metadata-related memleaks



commit 66502006dc968b05d095f08e108cc82bacfb3038
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 1 20:57:04 2009 -0400

    Plug various metadata-related memleaks
    
    These were reported in bug 590456.

 client/gdaemonvfs.c |    1 +
 metadata/metatree.c |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 21f023b..5a138b3 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1248,6 +1248,7 @@ _g_daemon_vfs_append_metadata_for_set (DBusMessage *message,
 				       DBUS_TYPE_STRING, &val,
 				       0);
 	}
+      g_free (current);
     }
   else if (type == G_FILE_ATTRIBUTE_TYPE_STRINGV)
     {
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 18bdc43..3c18172 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -1909,6 +1909,7 @@ meta_tree_enumerate_dir (MetaTree                         *tree,
 	break;
     }
  out:
+  g_free (res_path);
   g_hash_table_destroy (children);
   g_static_rw_lock_reader_unlock (&metatree_lock);
 }
@@ -2156,6 +2157,7 @@ meta_tree_enumerate_keys (MetaTree                         *tree,
 
     }
  out:
+  g_free (res_path);
   g_hash_table_destroy (keys);
   g_static_rw_lock_reader_unlock (&metatree_lock);
 }
@@ -3116,7 +3118,7 @@ find_mountpoint_for (MetaLookupCache *cache,
  */
 static char *
 expand_all_symlinks (const char *path,
-		     dev_t *dev_out)
+		     dev_t      *dev_out)
 {
   char *parent, *parent_expanded;
   char *basename, *res;
@@ -3137,6 +3139,7 @@ expand_all_symlinks (const char *path,
       g_free (parent_expanded);
       g_free (basename);
       g_free (parent);
+      g_free (path_copy);
     }
   else
     res = path_copy;



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