aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-06 01:52:09 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-06 01:52:09 +0000
commitf9abff0c698bd2d2c0f62075447b4dddc365d30b (patch)
tree8a16e9985d860be3e5df8f6e63fa2a848e0c4924
parent217043f00e1b30d747a8a2e734c3a76ced282944 (diff)
fixed a memory leak.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2411 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog4
-rw-r--r--src/colorlabel.c12
-rw-r--r--src/colorlabel.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 107af721..38a784bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-06
+
+ * src/colorlabel.[ch]: fixed a memory leak.
+
2010-01-05
* src/colorlabel.[ch]
diff --git a/src/colorlabel.c b/src/colorlabel.c
index d5812221..b58d2772 100644
--- a/src/colorlabel.c
+++ b/src/colorlabel.c
@@ -393,7 +393,7 @@ gint colorlabel_read_config(void)
return 0;
}
-void colorlabel_write_config(void)
+gint colorlabel_write_config(void)
{
gchar *path;
PrefFile *pfile;
@@ -406,7 +406,7 @@ void colorlabel_write_config(void)
if ((pfile = prefs_file_open(path)) == NULL) {
g_warning("failed to write colorlabelrc");
g_free(path);
- return;
+ return -1;
}
for (i = 0; i < LABEL_COLORS_ELEMS; i++) {
@@ -419,11 +419,17 @@ void colorlabel_write_config(void)
FILE_OP_ERROR(path, "fputs || fputc");
prefs_file_close_revert(pfile);
g_free(path);
- return;
+ return -1;
}
}
if (prefs_file_close(pfile) < 0) {
g_warning("failed to write colorlabelrc");
+ g_free(path);
+ return -1;
}
+
+ g_free(path);
+
+ return 0;
}
diff --git a/src/colorlabel.h b/src/colorlabel.h
index 13021098..d89e9652 100644
--- a/src/colorlabel.h
+++ b/src/colorlabel.h
@@ -37,6 +37,6 @@ guint colorlabel_get_color_menu_active_item (GtkWidget *menu);
void colorlabel_update_menu (void);
gint colorlabel_read_config (void);
-void colorlabel_write_config (void);
+gint colorlabel_write_config (void);
#endif /* COLORLABEL_H__ */