[Commits] [SCM] claws branch, master, updated. 3.18.0-214-ge73ec88c8

wwp at claws-mail.org wwp at claws-mail.org
Thu Sep 30 11:43:09 CEST 2021


The branch, master has been updated
       via  e73ec88c8c1c8b8b12359396f6475a2057b2aa41 (commit)
      from  911bd78319d675833e1ff897ef4df4d66190854b (commit)

Summary of changes:
 src/common/template.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit e73ec88c8c1c8b8b12359396f6475a2057b2aa41
Author: wwp <subscript at free.fr>
Date:   Thu Sep 30 11:42:47 2021 +0200

    Fix CID 1491210: resource leak.

diff --git a/src/common/template.c b/src/common/template.c
index 89b793c24..c11a8849f 100644
--- a/src/common/template.c
+++ b/src/common/template.c
@@ -156,11 +156,8 @@ static gint tmpl_compare(gconstpointer tmpl1, gconstpointer tmpl2)
 GSList *template_read_config(void)
 {
 	const gchar *path;
-	gchar *filename;
 	GDir *dir;
 	const gchar *dir_name;
-	GStatBuf s;
-	Template *tmpl;
 	GSList *tmpl_list = NULL;
 
 	path = get_template_dir();
@@ -178,12 +175,15 @@ GSList *template_read_config(void)
 	}
 
 	while ((dir_name = g_dir_read_name(dir)) != NULL) {
-		filename = g_strconcat(path, G_DIR_SEPARATOR_S,
+		Template *tmpl;
+		GStatBuf s;
+		gchar *filename = filename = g_strconcat(path, G_DIR_SEPARATOR_S,
 				       dir_name, NULL);
 
 		if (g_stat(filename, &s) != 0 || !S_ISREG(s.st_mode) ) {
 			debug_print("%s:%d %s is not an ordinary file\n",
 				    __FILE__, __LINE__, filename);
+			g_free(filename);
 			continue;
 		}
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list