aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Hooper <adamh@src.gnome.org>2004-01-25 23:19:05 +0800
committerAdam Hooper <adamh@src.gnome.org>2004-01-25 23:19:05 +0800
commit0ac06564fe20c1e28724fed98411edb1de954639 (patch)
tree3dfc2477722405fe9bb0e5e1b46672233db7ed99
parent3581016c967e67030e184d9dbc856c0ba07deda2 (diff)
downloadgsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar.gz
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar.bz2
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar.lz
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar.xz
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.tar.zst
gsoc2013-epiphany-0ac06564fe20c1e28724fed98411edb1de954639.zip
Fixed early freeing of tmp_dir
-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;