[Commits] [SCM] claws branch, master, updated. 3.18.0-184-gd8833eba9

wwp at claws-mail.org wwp at claws-mail.org
Tue Sep 28 14:09:53 CEST 2021


The branch, master has been updated
       via  d8833eba98a94e586c755ac1d39d5ca444fa9cef (commit)
      from  38f6d3e79f57dee2dceb901381d67d20716722a5 (commit)

Summary of changes:
 src/plugins/tnef_parse/tnef_parse.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit d8833eba98a94e586c755ac1d39d5ca444fa9cef
Author: wwp <subscript at free.fr>
Date:   Tue Sep 28 14:09:28 2021 +0200

    Fix CID 1491121: resource leak.

diff --git a/src/plugins/tnef_parse/tnef_parse.c b/src/plugins/tnef_parse/tnef_parse.c
index 8434882a3..e68fe4ee6 100644
--- a/src/plugins/tnef_parse/tnef_parse.c
+++ b/src/plugins/tnef_parse/tnef_parse.c
@@ -97,7 +97,6 @@ static MimeInfo *tnef_dump_file(const gchar *filename, char *data, size_t size)
 	gchar *tmpfilename = NULL;
 	FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
 	GStatBuf statbuf;
-	gchar *content_type = NULL;
 	if (!fp) {
 		g_free(tmpfilename);
 		return NULL;
@@ -109,6 +108,8 @@ static MimeInfo *tnef_dump_file(const gchar *filename, char *data, size_t size)
 	sub_info->subtype = g_strdup("octet-stream");
 	
 	if (filename) {
+		gchar *content_type = NULL;
+
 		g_hash_table_insert(sub_info->typeparameters,
 				    g_strdup("filename"),
 				    g_strdup(filename));
@@ -119,8 +120,9 @@ static MimeInfo *tnef_dump_file(const gchar *filename, char *data, size_t size)
 			sub_info->subtype = g_strdup(strchr(content_type, '/')+1);
 			*(strchr(content_type, '/')) = '\0';
 			sub_info->type = procmime_get_media_type(content_type);
-			g_free(content_type);
 		}
+		if (content_type)
+			g_free(content_type);
 	} 
 
 	if (claws_fwrite(data, 1, size, fp) < size) {

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list