[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-325-g03565af05

wwp at claws-mail.org wwp at claws-mail.org
Thu Oct 7 09:11:07 CEST 2021


The branch, gtk3 has been updated
       via  03565af05e5079d02c31202976a4f926ccd64a4b (commit)
      from  a471705042de8306ee3b8e12b1774747f4f9f1ac (commit)

Summary of changes:
 src/folder.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit 03565af05e5079d02c31202976a4f926ccd64a4b
Author: wwp <subscript at free.fr>
Date:   Thu Oct 7 09:10:21 2021 +0200

    Fix CID 1491229: dereference after null check.

diff --git a/src/folder.c b/src/folder.c
index c763eaf38..97c71390e 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -414,7 +414,7 @@ void folder_item_remove(FolderItem *item)
 {
 	GNode *node, *start_node;
 	FolderUpdateData hookdata;
-	gchar *tags_file = NULL, *tags_dir = NULL;
+	gchar *tags_file = NULL;
 
 	cm_return_if_fail(item != NULL);
 	cm_return_if_fail(item->folder != NULL);
@@ -441,15 +441,19 @@ void folder_item_remove(FolderItem *item)
 		msgcache_destroy(item->cache);
 		item->cache = NULL;
 	}
+
 	tags_file = folder_item_get_tags_file(item);
-	if (tags_file)
+	if (tags_file) {
+		gchar *tags_dir;
+
 		claws_unlink(tags_file);
-	tags_dir = g_path_get_dirname(tags_file);
-	if (tags_dir)
-		rmdir(tags_dir);
 
+		tags_dir = g_path_get_dirname(tags_file);
+		if (tags_dir)
+			rmdir(tags_dir);
+		g_free(tags_dir);
+	}
 	g_free(tags_file);
-	g_free(tags_dir);
 
 	hookdata.folder = item->folder;
 	hookdata.update_flags = FOLDER_TREE_CHANGED | FOLDER_REMOVE_FOLDERITEM;

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list