[libchamplain] Fix freeing const string



commit 8a0ef3abe385a88273431d3b59fde86f4db6dc03
Author: JiÅ?í Techet <techet gmail com>
Date:   Sun Mar 21 04:12:06 2010 +0100

    Fix freeing const string
    
    g_get_tmp_dir () returns const string that must not be deallocated.
    Copy it first.
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-file-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlain-file-cache.c b/champlain/champlain-file-cache.c
index b7a7de2..b107a07 100644
--- a/champlain/champlain-file-cache.c
+++ b/champlain/champlain-file-cache.c
@@ -335,7 +335,7 @@ champlain_file_cache_constructed (GObject *object)
 #endif
         }
       else
-        priv->cache_dir = (gchar *) g_get_tmp_dir ();
+        priv->cache_dir = g_strdup (g_get_tmp_dir ());
     }
 
   init_cache (file_cache);



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