ekiga r6371 - in trunk: . lib/engine/addressbook/evolution lib/engine/addressbook/ldap lib/engine/presence/local-roster src/endpoints



Author: dsandras
Date: Thu Jun  5 21:13:44 2008
New Revision: 6371
URL: http://svn.gnome.org/viewvc/ekiga?rev=6371&view=rev

Log:
Fixed leaks.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/addressbook/evolution/evolution-book.cpp
   trunk/lib/engine/addressbook/evolution/evolution-book.h
   trunk/lib/engine/addressbook/ldap/ldap-book.cpp
   trunk/lib/engine/presence/local-roster/local-heap.cpp
   trunk/src/endpoints/manager.cpp
   trunk/src/endpoints/opal-gmconf-bridge.cpp

Modified: trunk/lib/engine/addressbook/evolution/evolution-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/evolution/evolution-book.cpp	(original)
+++ trunk/lib/engine/addressbook/evolution/evolution-book.cpp	Thu Jun  5 21:13:44 2008
@@ -186,6 +186,7 @@
 void
 Evolution::Book::on_book_opened (EBookStatus _status)
 {
+  EBookQuery *query = NULL;
   self = new Wrapper (*this);
 
   if (_status == E_BOOK_ERROR_OK) {
@@ -199,7 +200,11 @@
 
     (void)e_book_async_get_book_view (book, query, NULL, 100,
 				      on_book_view_obtained_c, self);
-  } else {
+
+    e_book_query_unref (query);
+
+  } 
+  else {
 
     book = NULL;
     removed.emit ();
@@ -207,9 +212,8 @@
 }
 
 Evolution::Book::Book (Ekiga::ServiceCore &_services,
-		       EBook *_book,
-		       EBookQuery *_query)
-  : services(_services), book(_book), query(_query), view(NULL)
+		       EBook *_book)
+  : services(_services), book(_book), view(NULL)
 {
   self = new Wrapper (*this);
 

Modified: trunk/lib/engine/addressbook/evolution/evolution-book.h
==============================================================================
--- trunk/lib/engine/addressbook/evolution/evolution-book.h	(original)
+++ trunk/lib/engine/addressbook/evolution/evolution-book.h	Thu Jun  5 21:13:44 2008
@@ -62,8 +62,7 @@
   public:
 
     Book (Ekiga::ServiceCore &_services,
-	  EBook *_book,
-	  EBookQuery *_query = e_book_query_field_exists (E_CONTACT_FULL_NAME));
+	  EBook *_book);
 
     ~Book ();
 
@@ -97,7 +96,6 @@
 
     Ekiga::ServiceCore &services;
     EBook *book;
-    EBookQuery *query;
     EBookView *view;
     Wrapper *self;
 

Modified: trunk/lib/engine/addressbook/ldap/ldap-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-book.cpp	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-book.cpp	Thu Jun  5 21:13:44 2008
@@ -91,18 +91,23 @@
     if (strncmp("givenName",attribute, 9) == 0) {
 
       values = ldap_get_values_len (context, message, attribute);
-      if (values[0] != NULL)
+      if (values[0] != NULL) {
 	name = std::string (values[0]->bv_val, values[0]->bv_len);
+        ldap_value_free_len (values);
+      }
     }
     if (strncmp ("telephoneNumber", attribute, 15) == 0) {
 
       values = ldap_get_values_len (context, message, attribute);
-      if (values[0] != NULL)
+      if (values[0] != NULL) {
 	call_address = std::string (values[0]->bv_val, values[0]->bv_len);
+        ldap_value_free_len (values);
+      }
     }
     ldap_memfree (attribute);
     attribute = ldap_next_attribute (context, message, ber);
   }
+  ber_free (ber, 0);
 
   if (!name.empty () && !call_address.empty ()) {
 
@@ -428,7 +433,7 @@
 
     return;
   }
-
+  (void) ldap_msgfree (msg_entry);
 
   attributes_vector.push_back ("givenname");
   attributes_vector.push_back (call_attribute);

Modified: trunk/lib/engine/presence/local-roster/local-heap.cpp
==============================================================================
--- trunk/lib/engine/presence/local-roster/local-heap.cpp	(original)
+++ trunk/lib/engine/presence/local-roster/local-heap.cpp	Thu Jun  5 21:13:44 2008
@@ -55,7 +55,7 @@
 
   presence_core = dynamic_cast<Ekiga::PresenceCore*>(core.get ("presence-core"));
 
-  const gchar *c_raw = gm_conf_get_string (KEY);
+  gchar *c_raw = gm_conf_get_string (KEY);
 
   // Build the XML document representing the contacts list from the configuration
   if (c_raw != NULL) {
@@ -75,8 +75,12 @@
 	  && child->name != NULL
 	  && xmlStrEqual (BAD_CAST ("entry"), child->name))
 	add (child);
+    
+    g_free (c_raw);
+
     // Or create a new XML document
-  } else {
+  } 
+  else {
 
     doc = xmlNewDoc (BAD_CAST "1.0");
     root = xmlNewDocNode (doc, NULL, BAD_CAST "list", NULL);

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Thu Jun  5 21:13:44 2008
@@ -665,13 +665,14 @@
 
 
 void 
-CallManager::OnMWIReceived (const PString & account,
-                          MessageWaitingType /*type*/,
-                          const PString & msgs)
+CallManager::OnMWIReceived (const PString & _acc,
+                            MessageWaitingType /*type*/,
+                            const PString & _msgs)
 {
-  runtime.run_in_main (sigc::bind (mwi_event.make_slot (), 
-                                   (const char *) account, 
-                                   (const char *) msgs));
+  std::string account = (const char *) _acc;
+  std::string summary = (const char *) _msgs;
+
+  runtime.run_in_main (sigc::bind (mwi_event.make_slot (), account, summary));
 }
 
 

Modified: trunk/src/endpoints/opal-gmconf-bridge.cpp
==============================================================================
--- trunk/src/endpoints/opal-gmconf-bridge.cpp	(original)
+++ trunk/src/endpoints/opal-gmconf-bridge.cpp	Thu Jun  5 21:13:44 2008
@@ -199,7 +199,9 @@
     codecs.append (v_codecs);
     manager.set_codecs (codecs);
 
+    g_slist_foreach (audio_codecs, (GFunc) g_free, NULL);
     g_slist_free (audio_codecs);
+    g_slist_foreach (video_codecs, (GFunc) g_free, NULL);
     g_slist_free (video_codecs);
 
     // Update the GmConf keys, in case we would have missed some codecs or
@@ -343,7 +345,7 @@
     else
       manager.set_tcp_ports (min_port, max_port);
 
-    g_free (couple);
+    g_strfreev (couple);
   }
 }
 



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