libgda r3106 - in trunk: . libgda



Author: vivien
Date: Wed Apr  2 21:02:53 2008
New Revision: 3106
URL: http://svn.gnome.org/viewvc/libgda?rev=3106&view=rev

Log:
2008-04-02  Vivien Malerba <malerba gnome-db org>

	* libgda/gda-set.c: fixed a double free problem, for bug #525601


Modified:
   trunk/ChangeLog
   trunk/libgda/gda-set.c

Modified: trunk/libgda/gda-set.c
==============================================================================
--- trunk/libgda/gda-set.c	(original)
+++ trunk/libgda/gda-set.c	Wed Apr  2 21:02:53 2008
@@ -738,19 +738,17 @@
 	}
 
 	/* setting prepared new names from sources (models) */
-	list = sources;
-	while (list) {
+	for (list = sources; list; list = list->next) {
 		str = g_object_get_data (G_OBJECT (list->data), "newname");
 		if (str) {
-			g_object_set_data_full (G_OBJECT (list->data), "name", str, g_free);
+			g_object_set_data_full (G_OBJECT (list->data), "name", g_strdup (str), g_free);
 			g_object_set_data (G_OBJECT (list->data), "newname", NULL);
 		}
 		str = g_object_get_data (G_OBJECT (list->data), "newdescr");
 		if (str) {
-			g_object_set_data_full (G_OBJECT (list->data), "descr", str, g_free);
+			g_object_set_data_full (G_OBJECT (list->data), "descr", g_strdup (str), g_free);
 			g_object_set_data (G_OBJECT (list->data), "newdescr", NULL);
 		}
-		list = g_slist_next (list);
 	}
 
 	/* holders' values, constraints: TODO */



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