[Commits] [SCM] claws branch, master, updated. 3.18.0-180-gf25ae8ceb
wwp at claws-mail.org
wwp at claws-mail.org
Mon Sep 27 19:35:03 CEST 2021
The branch, master has been updated
via f25ae8ceb2f41d00aef4ae94b5e6cc2b3cb97f36 (commit)
from 340e813e727d905fa535594e19b6089b2d2bd947 (commit)
Summary of changes:
src/procmime.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
- Log -----------------------------------------------------------------
commit f25ae8ceb2f41d00aef4ae94b5e6cc2b3cb97f36
Author: wwp <subscript at free.fr>
Date: Mon Sep 27 19:33:15 2021 +0200
Proper fix for CID 1491065 (resource leak).
diff --git a/src/procmime.c b/src/procmime.c
index c9f3559ab..2d01cf943 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -1031,20 +1031,21 @@ gchar *procmime_get_tmp_file_name(MimeInfo *mimeinfo)
if ((mimeinfo->type == MIMETYPE_TEXT) && !g_ascii_strcasecmp(mimeinfo->subtype, "html"))
base = g_strdup("mimetmp.html");
else {
- const gchar *basetmp;
-
- basetmp = procmime_mimeinfo_get_parameter(mimeinfo, "filename");
- if (basetmp == NULL)
- basetmp = procmime_mimeinfo_get_parameter(mimeinfo, "name");
- if (basetmp == NULL)
- basetmp = "mimetmp";
- basetmp = g_path_get_basename(basetmp);
- if (*basetmp == '\0') {
- g_free(basetmp);
- basetmp = g_strdup("mimetmp");
+ const gchar *basetmp1;
+ gchar *basetmp2;
+
+ basetmp1 = procmime_mimeinfo_get_parameter(mimeinfo, "filename");
+ if (basetmp1 == NULL)
+ basetmp1 = procmime_mimeinfo_get_parameter(mimeinfo, "name");
+ if (basetmp1 == NULL)
+ basetmp1 = "mimetmp";
+ basetmp2 = g_path_get_basename(basetmp1);
+ if (*basetmp2 == '\0') {
+ g_free(basetmp2);
+ basetmp2 = g_strdup("mimetmp");
}
- base = conv_filename_from_utf8(basetmp);
- g_free((gchar*)basetmp);
+ base = conv_filename_from_utf8(basetmp2);
+ g_free(basetmp2);
subst_for_shellsafe_filename(base);
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list