[Commits] [SCM] claws branch, master, updated. 3.18.0-161-gc771663a2
wwp at claws-mail.org
wwp at claws-mail.org
Sun Sep 26 17:23:33 CEST 2021
The branch, master has been updated
via c771663a2ee1618348c8233ef6d465306b1136f2 (commit)
from 3ad096b488230a360c5faad0883a31855c5bfa70 (commit)
Summary of changes:
src/summaryview.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
- Log -----------------------------------------------------------------
commit c771663a2ee1618348c8233ef6d465306b1136f2
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 ed999963b..4808b0786 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4997,7 +4997,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;
@@ -5026,14 +5026,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"),
@@ -5074,9 +5078,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