[Commits] [SCM] claws branch, master, updated. 3.18.0-243-gf6c082178

wwp at claws-mail.org wwp at claws-mail.org
Tue Oct 5 08:46:09 CEST 2021


The branch, master has been updated
       via  f6c082178f7362a8711f12fd80db078096777c06 (commit)
      from  89afcae324f122cb1a23500d16505228e10d3770 (commit)

Summary of changes:
 src/mimeview.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit f6c082178f7362a8711f12fd80db078096777c06
Author: wwp <subscript at free.fr>
Date:   Tue Oct 5 08:45:35 2021 +0200

    Fix CID 1491285: resource leak.
    Fix dead code, an another resource leak.

diff --git a/src/mimeview.c b/src/mimeview.c
index a57b061fe..24b89495f 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -1726,7 +1726,7 @@ static void mimeview_drag_data_get(GtkWidget	    *widget,
 				   guint	     time,
 				   MimeView	    *mimeview)
 {
-	gchar *filename = NULL, *uriname, *tmp;
+	gchar *filename = NULL, *uriname, *tmp = NULL;
 	MimeInfo *partinfo;
 	gint err;
 	gint count = 0;
@@ -1739,7 +1739,12 @@ static void mimeview_drag_data_get(GtkWidget	    *widget,
 
 	if (strlen(get_part_name(partinfo)) > 0) {
 		filename = g_path_get_basename(get_part_name(partinfo));
-		if (*filename == '\0') return;
+		if (filename) {
+			if (*filename == '\0') {
+				g_free(filename);
+				return;
+			}
+		}
 	} else if (partinfo->type == MIMETYPE_MESSAGE 
 		   && !g_ascii_strcasecmp(partinfo->subtype, "rfc822")) {
 		gchar *name = NULL;
@@ -1775,13 +1780,12 @@ static void mimeview_drag_data_get(GtkWidget	    *widget,
 		tmp = conv_codeset_strdup(filename,
 				conv_get_locale_charset_str(),
 				CS_UTF_8);
-	else
-		tmp = g_strdup(filename);
 
 	if (tmp == NULL) {
 		g_warning("filename not in UTF-8");
-		tmp = g_strdup("Unnamed part");
+		tmp = g_strdup(filename);
 	}
+	g_free(filename);
 	filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
 			       tmp, NULL);
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list