[beast] SFI: avoid double-free of g_get_tmp_dir() results



commit 0bc5582c9d6ddeb23d236b2f55b59bf9b414a66a
Author: Tim Janik <timj gnu org>
Date:   Fri Apr 6 03:03:32 2012 +0200

    SFI: avoid double-free of g_get_tmp_dir() results

 sfi/sfifilecrawler.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/sfi/sfifilecrawler.cc b/sfi/sfifilecrawler.cc
index 1b901d3..6f802de 100644
--- a/sfi/sfifilecrawler.cc
+++ b/sfi/sfifilecrawler.cc
@@ -31,7 +31,7 @@ static gchar*   get_user_home (const gchar *user,
 
 
 /* --- variables --- */
-static gchar *init_cwd = NULL;
+static char *init_cwd = NULL;
 
 
 /* --- functions --- */
@@ -42,7 +42,7 @@ _sfi_init_file_crawler (void)
   if (!init_cwd || !g_path_is_absolute (init_cwd))
     {
       g_free (init_cwd);
-      init_cwd = g_get_tmp_dir ();
+      init_cwd = g_strdup (g_get_tmp_dir ());
     }
   if (!init_cwd || !g_path_is_absolute (init_cwd))
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]