[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-305-gc986621b3

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


The branch, gtk3 has been updated
       via  c986621b3f5d6e7910338718a12b537a244c705d (commit)
      from  0fc77dc8c5a8f789dac30489a8afb2211c4419fe (commit)

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


- Log -----------------------------------------------------------------
commit c986621b3f5d6e7910338718a12b537a244c705d
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 dcc7974df..eb25edb1d 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -1750,7 +1750,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;
@@ -1763,7 +1763,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;
@@ -1799,13 +1804,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