Hello,

I've attached a small patch with those the above.

Kind regards,
Moritz
From a881ec607436ac02c640f01f6dbbb54f829595e5 Mon Sep 17 00:00:00 2001
From: Moritz Lipp <[email protected]>
Date: Sun, 13 Jan 2013 10:57:24 +0100
Subject: [PATCH] Release strings allocated by dt_conf_get_string

---
 src/gui/preferences.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gui/preferences.c b/src/gui/preferences.c
index 46da220..3222029 100644
--- a/src/gui/preferences.c
+++ b/src/gui/preferences.c
@@ -1112,10 +1112,13 @@ static void import_export(GtkButton *button, gpointer 
data)
                 NULL);
     gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(chooser),
         TRUE);
-    if(dt_conf_get_string("ui_last/export_path"))
+    gchar* exported_path = dt_conf_get_string("ui_last/exported_path");
+    if(exported_path != NULL) {
       gtk_file_chooser_set_current_folder(
         GTK_FILE_CHOOSER(chooser),
-        dt_conf_get_string("ui_last/export_path"));
+        exported_path);
+      g_free(exported_path);
+    }
     gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser), "keyboardrc");
     if(gtk_dialog_run(GTK_DIALOG(chooser)) == GTK_RESPONSE_ACCEPT)
     {
@@ -1138,10 +1141,13 @@ static void import_export(GtkButton *button, gpointer 
data)
                 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                 NULL);
 
-    if(dt_conf_get_string("ui_last/import_path"))
+    gchar* import_path = dt_conf_get_string("ui_last/import_path");
+    if(import_path != NULL) {
       gtk_file_chooser_set_current_folder(
         GTK_FILE_CHOOSER(chooser),
-        dt_conf_get_string("ui_last/import_path"));
+        import_path);
+      g_free(import_path);
+    }
     if(gtk_dialog_run(GTK_DIALOG(chooser)) == GTK_RESPONSE_ACCEPT)
     {
       if(g_file_test(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)),
-- 
1.8.1

Attachment: pgphuxdlsQXHH.pgp
Description: PGP signature

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
darktable-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to