[libgda] dsn-assistant: fix infinite loop on pre-existing DSN



commit d91e53023b4474a0cc60861bb2a7b9b1aa385afe
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Sep 10 10:09:55 2018 -0500

    dsn-assistant: fix infinite loop on pre-existing DSN

 control-center/gdaui-dsn-assistant.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/control-center/gdaui-dsn-assistant.c b/control-center/gdaui-dsn-assistant.c
index 2209cc4dd..4c47e1b28 100644
--- a/control-center/gdaui-dsn-assistant.c
+++ b/control-center/gdaui-dsn-assistant.c
@@ -335,9 +335,11 @@ dsn_name_changed_cb (GtkEntry *entry, GdauiDsnAssistant *assistant)
                gchar *str = NULL;
 
                do {
-                       g_free (str);
+                       if (str != NULL)
+                               g_free (str);
                        str = g_strdup_printf ("%s_%d", name, i);
                        dsn_info = gda_config_get_dsn_info (str);
+                       i++;
                } while (dsn_info);
 
                gtk_entry_set_text (entry, str);


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