[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-282-gfb466b8a5

wwp at claws-mail.org wwp at claws-mail.org
Thu Sep 30 21:37:34 CEST 2021


The branch, gtk3 has been updated
       via  fb466b8a50d9505060b6529e020e9dafac36f1b4 (commit)
      from  61026543f51971082001d6cabf17ff6ede22058a (commit)

Summary of changes:
 src/mh.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit fb466b8a50d9505060b6529e020e9dafac36f1b4
Author: wwp <subscript at free.fr>
Date:   Thu Sep 30 21:37:26 2021 +0200

    Fix CID 1491096, 1491263, 1491328, 1491348: resource leaks.

diff --git a/src/mh.c b/src/mh.c
index 42b0e49f4..bb77cd664 100644
--- a/src/mh.c
+++ b/src/mh.c
@@ -809,17 +809,26 @@ static gint mh_scan_tree(Folder *folder)
 		if (is_file_exist(dir)) { \
 			g_warning("file '%s' already exists, " \
 				    "can't create folder", dir); \
+			if (rootpath) \
+				g_free(rootpath); \
+			if (path) \
+				g_free(path); \
 			return -1; \
 		} \
-		if (make_dir_hier(dir) < 0) \
+		if (make_dir_hier(dir) < 0) { \
+			if (rootpath) \
+				g_free(rootpath); \
+			if (path) \
+				g_free(path); \
 			return -1; \
+		} \
 		debug_print("Created dir '%s'\n", dir); \
 	} \
 }
 
 static gint mh_create_tree(Folder *folder)
 {
-	gchar *rootpath, *f, *path;
+	gchar *rootpath, *f, *path = NULL;
 
 	cm_return_val_if_fail(folder != NULL, -1);
 
@@ -1042,6 +1051,7 @@ static gint mh_rename_folder(Folder *folder, FolderItem *item,
 	real_name = mh_filename_from_utf8(name);
 	newpath = g_strconcat(dirname, G_DIR_SEPARATOR_S, real_name, NULL);
 	g_free(real_name);
+	g_free(dirname);
 
 	if (g_rename(oldpath, newpath) < 0) {
 		FILE_OP_ERROR(oldpath, "rename");
@@ -1325,6 +1335,7 @@ static gchar *get_unseen_seq_name(void)
 			get_home_dir(), G_DIR_SEPARATOR_S,
 			".mh_profile", NULL);
 		FILE *fp = claws_fopen(profile_path, "r");
+		g_free(profile_path);
 		if (fp) {
 			while (claws_fgets(buf, sizeof(buf), fp) != NULL) {
 				if (!strncmp(buf, "Unseen-Sequence:", strlen("Unseen-Sequence:"))) {

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list