[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-238-g3e0a4c095

wwp at claws-mail.org wwp at claws-mail.org
Mon Sep 27 19:35:11 CEST 2021


The branch, gtk3 has been updated
       via  3e0a4c09523ad7476661b7c44a2e0d4bc53a4049 (commit)
      from  1d608b800a0bd7f8b2fdde36a7c56d5afc10828c (commit)

Summary of changes:
 src/procmime.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 3e0a4c09523ad7476661b7c44a2e0d4bc53a4049
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 286e3123b..b7798b0ce 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -1070,20 +1070,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