aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-28 07:41:17 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-28 07:41:17 +0000
commit39397cc63092ed3e8bf91e89ea070dfc1a44114e (patch)
tree3c940b57d2f45d848f177ce07c5bacead5146416 /src
parent3aeaf7ca1dd656a5e71d571ca09862d0f8b965e1 (diff)
template.c: fixed a memory leak.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@55 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/template.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/template.c b/src/template.c
index ddfb2b5f..5402be67 100644
--- a/src/template.c
+++ b/src/template.c
@@ -133,7 +133,8 @@ GSList *template_read_config(void)
while ((de = readdir(dp)) != NULL) {
if (*de->d_name == '.') continue;
- filename = g_strconcat(path, G_DIR_SEPARATOR_S, de->d_name, NULL);
+ filename = g_strconcat(path, G_DIR_SEPARATOR_S,
+ de->d_name, NULL);
if (stat(filename, &s) != 0 || !S_ISREG(s.st_mode) ) {
debug_print("%s:%d %s is not an ordinary file\n",
@@ -144,6 +145,7 @@ GSList *template_read_config(void)
tmpl = template_load(filename);
if (tmpl)
tmpl_list = g_slist_append(tmpl_list, tmpl);
+
g_free(filename);
}
@@ -199,7 +201,9 @@ void template_write_config(GSList *tmpl_list)
fprintf(fp, "Subject: %s\n", tmpl->subject);
fputs("\n", fp);
fwrite(tmpl->value, sizeof(gchar) * strlen(tmpl->value), 1, fp);
+
fclose(fp);
+ g_free(filename);
}
}