libgda r3045 - in branches/V4-branch: . libgda



Author: arminb
Date: Sat Jan 26 23:05:44 2008
New Revision: 3045
URL: http://svn.gnome.org/viewvc/libgda?rev=3045&view=rev

Log:
2008-01-26  Armin Burgmeier  <armin openismus com>

	* libgda/gda-server-operation.c:
	(xml_load_file): Don't leak this_lang, ignore entry when id is NULL
	which caused a segfault on Windows.


Modified:
   branches/V4-branch/ChangeLog
   branches/V4-branch/libgda/gda-server-operation.c

Modified: branches/V4-branch/libgda/gda-server-operation.c
==============================================================================
--- branches/V4-branch/libgda/gda-server-operation.c	(original)
+++ branches/V4-branch/libgda/gda-server-operation.c	Sat Jan 26 23:05:44 2008
@@ -750,17 +750,25 @@
 
 		/* don't care about entries for the wrong locale */
 		this_lang = xmlGetProp(node, (xmlChar*)"lang");
-		if (this_lang && strncmp ((gchar*)this_lang, lang, strlen ((gchar*)this_lang))) {
-			g_free (this_lang);
+		if (this_lang) {
+			if (strncmp ((gchar*)this_lang, lang, strlen ((gchar*)this_lang))) {
+				xmlFree (this_lang);
+				node = node->next;
+				continue;
+			}
+
+			xmlFree(this_lang);
+		}
+
+		id = xmlGetProp (node, BAD_CAST "id");
+		if (!id) {
 			node = node->next;
 			continue;
 		}
 
-		id = xmlGetProp (node, BAD_CAST "id");
 		complete_path = g_strdup_printf ("%s/%s", root ? root : "", id);
 		path_name = g_strdup ((gchar*)id);
-		if (id)
-			xmlFree (id);
+		xmlFree (id);
 
 		old_opnode = node_find (op, complete_path);
 		if (old_opnode) {



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