[Commits] [SCM] claws branch, master, updated. 3.18.0-252-g5d2612f9c

wwp at claws-mail.org wwp at claws-mail.org
Tue Oct 5 13:02:29 CEST 2021


The branch, master has been updated
       via  5d2612f9ce9ea43a88a70bf941d4558499de5357 (commit)
      from  eae61be5c5942b403ab34526343506d135bbdfad (commit)

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


- Log -----------------------------------------------------------------
commit 5d2612f9ce9ea43a88a70bf941d4558499de5357
Author: wwp <subscript at free.fr>
Date:   Tue Oct 5 13:02:17 2021 +0200

    Fix CID 1492192: resource leak.

diff --git a/src/addressbook.c b/src/addressbook.c
index 832af17f8..17830ffa3 100644
--- a/src/addressbook.c
+++ b/src/addressbook.c
@@ -4409,7 +4409,6 @@ static GtkCMCTreeNode *addressbook_node_add_folder(
 {
 	GtkCMCTree *ctree = GTK_CMCTREE(addrbook.ctree);
 	GtkCMCTreeNode *newNode = NULL;
-	AdapterFolder *adapter;
 	AddressTypeControlItem *atci = NULL;
 	GList *listItems = NULL;
 	gchar *name;
@@ -4434,7 +4433,7 @@ static GtkCMCTreeNode *addressbook_node_add_folder(
 		newNode = node;
 	}
 	else {
-		adapter = g_new0( AdapterFolder, 1 );
+		AdapterFolder *adapter = g_new0( AdapterFolder, 1 );
 		ADDRESS_OBJECT_TYPE(adapter) = ADDR_ITEM_FOLDER;
 		ADDRESS_OBJECT_NAME(adapter) = g_strdup( ADDRITEM_NAME(itemFolder) );
 		adapter->itemFolder = itemFolder;
@@ -4446,6 +4445,8 @@ static GtkCMCTreeNode *addressbook_node_add_folder(
 		if( newNode ) {
 			gtk_cmctree_node_set_row_data_full( ctree, newNode, adapter,
 				addressbook_free_treenode );
+		} else {
+			addrbookctl_free_folder(adapter);
 		}
 	}
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list