aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/ephy-file-helpers.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f8e40703e..8ec06b10d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-25 Adam Hooper <adamh@cvs.gnome.org>
+
+ * lib/ephy-file-helpers.c: (ephy_file_tmp_dir):
+
+ mkdtemp() modifies *template in-place. So it shouldn't be freed.
+
2004-01-25 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-tabs-menu.c: (tab_set_action_accelerator):
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index d95641591..481d170c6 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -46,11 +46,17 @@ ephy_file_tmp_dir (void)
char *partial_name;
char *full_name;
- partial_name = g_strconcat ("epiphany-", g_get_user_name (), "-XXXXXX", NULL);
- full_name = g_build_filename (g_get_tmp_dir (), partial_name, NULL);
+ partial_name = g_strconcat ("epiphany-", g_get_user_name (),
+ "-XXXXXX", NULL);
+ full_name = g_build_filename (g_get_tmp_dir (), partial_name,
+ NULL);
tmp_dir = mkdtemp (full_name);
- g_free(partial_name);
- g_free (full_name);
+ g_free (partial_name);
+
+ if (tmp_dir == NULL)
+ {
+ g_free (full_name);
+ }
}
return tmp_dir;