diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-08-17 15:16:38 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2009-08-17 15:16:38 +0200 |
commit | 893a6ef066756ac5f996d7f518034b1b1901eaa5 (patch) | |
tree | a4a2aed9de72da30edc01f4a0252118eb18c7299 /metadata | |
parent | 612452d52c1806696ef0c45f0b27ce6d07e315a3 (diff) | |
download | gvfs-893a6ef066756ac5f996d7f518034b1b1901eaa5.tar.gz |
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.
Diffstat (limited to 'metadata')
-rw-r--r-- | metadata/metabuilder.c | 5 | ||||
-rw-r--r-- | metadata/metatree.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/metadata/metabuilder.c b/metadata/metabuilder.c index 963586d7..a4a2043c 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 3a52317a..67c29a60 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; |