[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-219-g45f75aeea

wwp at claws-mail.org wwp at claws-mail.org
Sun Sep 26 17:23:37 CEST 2021


The branch, gtk3 has been updated
       via  45f75aeeaa48e54e6d8b727ccc26a13cc3155678 (commit)
      from  d5bb4a31286511a301d2f33c153b5e14676355fd (commit)

Summary of changes:
 src/summaryview.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit 45f75aeeaa48e54e6d8b727ccc26a13cc3155678
Author: wwp <subscript at free.fr>
Date:   Sun Sep 26 17:23:11 2021 +0200

    Fix CID 1491131 and 1491292: resource leaks.

diff --git a/src/summaryview.c b/src/summaryview.c
index b6dec90e2..ecb04ac53 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4968,7 +4968,7 @@ void summary_save_as(SummaryView *summaryview)
 	GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
 	MsgInfo *msginfo;
 	gchar *filename = NULL;
-	gchar *src, *dest;
+	gchar *src, *dest, *dest_default;
 	gchar *tmp;
 	gchar *filedir = NULL;
 
@@ -4997,14 +4997,18 @@ void summary_save_as(SummaryView *summaryview)
 		}
 	}
 
-	dest = filename;
-	filename = NULL;
-	if (!dest) return;
-	if (prefs_common.attach_save_dir && *prefs_common.attach_save_dir)
-		dest = g_strconcat(prefs_common.attach_save_dir, G_DIR_SEPARATOR_S,
-				   dest, NULL);
-	dest = filesel_select_file_save(_("Save as"), dest);
-	if (!dest) return;
+	if (!filename)
+		return;
+	if (prefs_common.attach_save_dir && *prefs_common.attach_save_dir) {
+        gchar * f = g_strconcat(prefs_common.attach_save_dir, G_DIR_SEPARATOR_S,
+				   filename, NULL);
+        g_free(filename);
+        filename = f;
+	}
+	dest = filesel_select_file_save(_("Save as"), filename);
+    g_free(filename);
+	if (!dest)
+		return;
 
 	if (is_file_exist(dest)) {
 		aval = alertpanel(_("Append or Overwrite"),
@@ -5045,9 +5049,12 @@ void summary_save_as(SummaryView *summaryview)
 	}
 
 	filedir = g_path_get_dirname(dest);
-	if (filedir && strcmp(filedir, ".")) {
-		g_free(prefs_common.attach_save_dir);
-		prefs_common.attach_save_dir = g_filename_to_utf8(filedir, -1, NULL, NULL, NULL);
+	if (filedir) {
+		if (strcmp(filedir, ".")) {
+			g_free(prefs_common.attach_save_dir);
+			prefs_common.attach_save_dir = g_filename_to_utf8(filedir, -1, NULL, NULL, NULL);
+		}
+        g_free(filedir);
 	}
 
 	g_free(dest);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list