aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-11-27 07:06:18 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-11-27 07:06:18 +0000
commit6d46ef5c157b87f6a44e009b4fc7f60078ecce59 (patch)
tree29c488db9daf4fb7d26d8e56c69e6f5cc6b9b246 /libsylph
parentf6ae755743b4ca15509098a5374e93f7450770e4 (diff)
fixed fp and memory leaks.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3300 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procmime.c2
-rw-r--r--libsylph/procmsg.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index 99b0a310..86192599 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -1722,6 +1722,8 @@ static GList *procmime_parse_mailcap(const gchar *file)
list = g_list_append(list, mailcap);
}
+ fclose(fp);
+
return list;
}
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c
index 869c59de..fe65395a 100644
--- a/libsylph/procmsg.c
+++ b/libsylph/procmsg.c
@@ -2018,8 +2018,8 @@ gint procmsg_concat_partial_messages(GSList *mlist, const gchar *file)
g_free(cur_id);
skip:
- fclose(fp);
procmime_mimeinfo_free_all(mimeinfo);
+ fclose(fp);
}
if (!part_id) {
@@ -2094,6 +2094,8 @@ skip:
out_size = get_left_file_size(fp);
if (out_size < 0) {
g_warning("cannot tell left file size of part %d\n", i + 1);
+ procmime_mimeinfo_free_all(mimeinfo);
+ fclose(fp);
fclose(tmp_fp);
g_unlink(file);
return -1;
@@ -2101,6 +2103,8 @@ skip:
empty_line_size = get_last_empty_line_size(fp, out_size);
if (empty_line_size < 0) {
g_warning("cannot get last empty line size of part %d\n", i + 1);
+ procmime_mimeinfo_free_all(mimeinfo);
+ fclose(fp);
fclose(tmp_fp);
g_unlink(file);
return -1;
@@ -2109,13 +2113,15 @@ skip:
if (append_file_part(fp, ftell(fp), out_size - empty_line_size,
tmp_fp) < 0) {
g_warning("write failed\n");
+ procmime_mimeinfo_free_all(mimeinfo);
+ fclose(fp);
fclose(tmp_fp);
g_unlink(file);
return -1;
}
- fclose(fp);
procmime_mimeinfo_free_all(mimeinfo);
+ fclose(fp);
}
fclose(tmp_fp);