ekiga r7205 - in trunk: . lib/engine/addressbook/call-history lib/engine/components/resource-list lib/engine/framework lib/engine/presence/local-roster



Author: jpuydt
Date: Sun Oct 12 07:29:37 2008
New Revision: 7205
URL: http://svn.gnome.org/viewvc/ekiga?rev=7205&view=rev

Log:
Fixed leaks in XML-handling code (bug #555671).

Modified:
   trunk/ChangeLog
   trunk/lib/engine/addressbook/call-history/history-contact.cpp
   trunk/lib/engine/components/resource-list/rl-heap.cpp
   trunk/lib/engine/framework/menu-xml.cpp
   trunk/lib/engine/presence/local-roster/local-presentity.cpp

Modified: trunk/lib/engine/addressbook/call-history/history-contact.cpp
==============================================================================
--- trunk/lib/engine/addressbook/call-history/history-contact.cpp	(original)
+++ trunk/lib/engine/addressbook/call-history/history-contact.cpp	Sun Oct 12 07:29:37 2008
@@ -53,14 +53,18 @@
     = dynamic_cast<Ekiga::ContactCore*>(core.get ("contact-core"));
 
   xml_str = xmlGetProp (node, (const xmlChar *)"type");
-  if (xml_str != NULL)
+  if (xml_str != NULL) {
+
     m_type = (call_type)(xml_str[0] - '0'); // FIXME: I don't like it!
-  xmlFree (xml_str);
+    xmlFree (xml_str);
+  }
 
   xml_str = xmlGetProp (node, (const xmlChar *)"uri");
-  if (xml_str != NULL)
+  if (xml_str != NULL) {
+
     uri = (const char *)xml_str;
-  xmlFree (xml_str);
+    xmlFree (xml_str);
+  }
 
   for (xmlNodePtr child = node->children ;
        child != NULL ;

Modified: trunk/lib/engine/components/resource-list/rl-heap.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-heap.cpp	(original)
+++ trunk/lib/engine/components/resource-list/rl-heap.cpp	Sun Oct 12 07:29:37 2008
@@ -281,8 +281,11 @@
 
   {
     xmlChar* str = xmlGetProp (entry, BAD_CAST "uri");
-    if (str != NULL)
+    if (str != NULL) {
+
       entry_uri = g_strdup ((const gchar*)str);
+      xmlFree (str);
+    }
   }
 
   for (xmlNodePtr child = entry->children; child != NULL; child = child->next)

Modified: trunk/lib/engine/framework/menu-xml.cpp
==============================================================================
--- trunk/lib/engine/framework/menu-xml.cpp	(original)
+++ trunk/lib/engine/framework/menu-xml.cpp	Sun Oct 12 07:29:37 2008
@@ -97,6 +97,7 @@
 		populate_item (core, builder, child, true);
 	      if (xmlStrEqual (BAD_CAST "internal", attr))
 		populate_item (core, builder, child, false);
+	      xmlFree (attr);
 	    }
 	  }
 	  if (xmlStrEqual (BAD_CAST "separator", child->name))

Modified: trunk/lib/engine/presence/local-roster/local-presentity.cpp
==============================================================================
--- trunk/lib/engine/presence/local-roster/local-presentity.cpp	(original)
+++ trunk/lib/engine/presence/local-roster/local-presentity.cpp	Sun Oct 12 07:29:37 2008
@@ -57,9 +57,11 @@
   presence_core = dynamic_cast<Ekiga::PresenceCore*>(core.get ("presence-core"));
 
   xml_str = xmlGetProp (node, (const xmlChar *)"uri");
-  if (xml_str != NULL)
+  if (xml_str != NULL) {
+
     uri = (const char *)xml_str;
-  xmlFree (xml_str);
+    xmlFree (xml_str);
+  }
 
   for (xmlNodePtr child = node->children ;
        child != NULL ;



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