Don't leak parent_path, even on error

* e-folder-tree.c (e_folder_tree_add): Don't leak parent_path,
        even on error

svn path=/trunk/; revision=21498
This commit is contained in:
Dan Winship
2003-06-20 14:37:29 +00:00
parent a6056c7493
commit c20675d201
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-06-19 Dan Winship <danw@ximian.com>
* e-folder-tree.c (e_folder_tree_add): Don't leak parent_path,
even on error
2003-06-16 Frederic Crozat <fcrozat@mandrakesoft.com>
* Makefile.am:

View File

@ -262,8 +262,10 @@ e_folder_tree_add (EFolderTree *folder_tree,
if (parent_folder == NULL) {
g_warning ("e_folder_tree_add() -- Trying to add a subfolder to a path that does not exist yet -- %s",
parent_path);
g_free (parent_path);
return FALSE;
}
g_free (parent_path);
folder = g_hash_table_lookup (folder_tree->path_to_folder, path);
if (folder != NULL) {
@ -285,8 +287,6 @@ e_folder_tree_add (EFolderTree *folder_tree,
g_hash_table_insert (folder_tree->path_to_folder, folder->path, folder);
g_hash_table_insert (folder_tree->data_to_path, data, folder->path);
g_free (parent_path);
return TRUE;
}