aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-file-helpers.c
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 /lib/ephy-file-helpers.c
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
Diffstat (limited to 'lib/ephy-file-helpers.c')
-rw-r--r--lib/ephy-file-helpers.c14
1 files changed, 10 insertions, 4 deletions
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;