[Commits] [SCM] claws branch, master, updated. 3.14.0-70-g720b9a5

ticho at claws-mail.org ticho at claws-mail.org
Sat Sep 10 01:13:50 CEST 2016


The branch, master has been updated
       via  720b9a5429ea3ddfb5af01400eb67b9d2abac0a2 (commit)
      from  b274c72a2b5b7b482a48b75bee15d13eecf3d8cd (commit)

Summary of changes:
 src/folder.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit 720b9a5429ea3ddfb5af01400eb67b9d2abac0a2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Sep 10 01:09:13 2016 +0200

    Fixed two memory leaks when creating folderitems.
    
    The Folderitem's "node" member is set to a new empty
    GNode in folder_item_new(), but is later set to
    another newly allocated GNode.
    
    This commit removes the extra allocation in one case
    (folder_new()), and gets rid of the original GNode
    in another case, where avoiding the second allocation
    is impossible without completely rewriting the recursive
    folderitem appending in folder_get_from_xml().

diff --git a/src/folder.c b/src/folder.c
index b653bac..902b990 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -192,7 +192,7 @@ Folder *folder_new(FolderClass *klass, const gchar *name, const gchar *path)
 		return NULL;
 	}
 	item->folder = folder;
-	folder->node = item->node = g_node_new(item);
+	folder->node = item->node;
 	folder->data = NULL;
 
 	return folder;
@@ -4046,6 +4046,7 @@ static gpointer xml_to_folder_item(gpointer nodedata, gpointer data)
 	}
 
 	item = folder_item_new(folder, "", "");
+	g_node_destroy(item->node);
 	if (folder->klass->item_set_xml != NULL)
 		folder->klass->item_set_xml(folder, item, xmlnode->tag);
 	else

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list