[gvfs] Fix various memory leaks
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gvfs] Fix various memory leaks
- Date: Mon, 17 Aug 2009 13:17:51 +0000 (UTC)
commit 893a6ef066756ac5f996d7f518034b1b1901eaa5
Author: Alexander Larsson <alexl redhat com>
Date: Mon Aug 17 15:16:38 2009 +0200
Fix various memory leaks
Testing a simple loop of writes long enough to cause a log wrap
showed a bunch of leaks in valgrind. This fixes them all.
metadata/metabuilder.c | 5 +++--
metadata/metatree.c | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/metadata/metabuilder.c b/metadata/metabuilder.c
index 963586d..a4a2043 100644
--- a/metadata/metabuilder.c
+++ b/metadata/metabuilder.c
@@ -590,6 +590,7 @@ string_block_end (GString *out,
offset = GPOINTER_TO_UINT (l->data);
set_uint32 (out, offset, string_offset);
}
+ g_list_free (offsets);
}
g_hash_table_destroy (string_block);
@@ -675,7 +676,7 @@ write_children (GString *out,
while (files != NULL)
{
file = files->data;
- files = g_list_remove_link (files, files);
+ files = g_list_delete_link (files, files);
if (file->children == NULL)
continue; /* No children, skip file */
@@ -770,7 +771,7 @@ write_metadata (GString *out,
while (files != NULL)
{
file = files->data;
- files = g_list_remove_link (files, files);
+ files = g_list_delete_link (files, files);
if (file->children == NULL)
continue; /* No children, skip file */
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 3a52317..67c29a6 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -438,6 +438,7 @@ meta_tree_init (MetaTree *tree)
dir = g_path_get_dirname (tree->filename);
g_mkdir_with_parents (dir, 0700);
+ g_free (dir);
builder = meta_builder_new ();
retried = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]