r17369 - in /desktop/experimental/at-spi/debian: changelog patches/01-memory_leaks.patch

mlang at users.alioth.debian.org mlang at users.alioth.debian.org
Sun Nov 2 17:15:11 UTC 2008


Author: mlang
Date: Sun Nov  2 17:15:11 2008
New Revision: 17369

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=17369
Log:
debian/patches/01-memory_leaks.patch: Add patch taken from trunk.

Added:
    desktop/experimental/at-spi/debian/patches/01-memory_leaks.patch
Modified:
    desktop/experimental/at-spi/debian/changelog

Modified: desktop/experimental/at-spi/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/at-spi/debian/changelog?rev=17369&op=diff
==============================================================================
--- desktop/experimental/at-spi/debian/changelog (original)
+++ desktop/experimental/at-spi/debian/changelog Sun Nov  2 17:15:11 2008
@@ -1,8 +1,9 @@
-at-spi (1.24.0-2) UNRELEASED; urgency=low
+at-spi (1.24.0-2) experimental; urgency=low
 
   * debian/watch: Update.
-
- -- Mario Lang <mlang at debian.org>  Tue, 21 Oct 2008 19:59:18 +0200
+  * debian/patches/01-memory_leaks.patch: Add patch taken from trunk.
+
+ -- Mario Lang <mlang at debian.org>  Sun, 02 Nov 2008 18:08:08 +0100
 
 at-spi (1.24.0-1) experimental; urgency=low
 

Added: desktop/experimental/at-spi/debian/patches/01-memory_leaks.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/at-spi/debian/patches/01-memory_leaks.patch?rev=17369&op=file
==============================================================================
--- desktop/experimental/at-spi/debian/patches/01-memory_leaks.patch (added)
+++ desktop/experimental/at-spi/debian/patches/01-memory_leaks.patch Sun Nov  2 17:15:11 2008
@@ -1,0 +1,405 @@
+Fix a few momery leaks and reversed null-checks.
+Taken from at-spi svn HEAD.
+
+diff -ru at-spi-1.24.0.orig/ChangeLog at-spi-1.24.0/ChangeLog
+--- at-spi-1.24.0.orig/ChangeLog	2008-09-22 10:54:40.000000000 +0200
++++ at-spi-1.24.0/ChangeLog	2008-11-02 18:00:04.000000000 +0100
+@@ -1,3 +1,36 @@
++2008-09-28  Li Yuan  <li.yuan at sun.com>
++
++	* cspi/bonobo/cspi-bonobo.c: (cspi_init):
++	Bug #552469. Patch from Gerd Kohlberger. Fix memory leak.
++
++2008-09-27  Li Yuan  <li.yuan at sun.com>
++
++	* atk-bridge/bridge.c: (spi_atk_bridget_get_dec):
++	Bug #547943. Patch from Matthias Clasen. Print warning message only
++	in debug mode.
++
++2008-09-27  Li Yuan  <li.yuan at sun.com>
++
++	* libspi/accessible.c:
++	(impl_accessibility_accessible_get_attributes):
++	* libspi/document.c: (impl_getAttributes):
++	* libspi/text.c: (impl_getAttributeRun),
++	(impl_getDefaultAttributeSet):
++	Bug #525519. Fix memory leak. Patch from Mike Gorse.
++
++2008-09-27  Li Yuan  <li.yuan at sun.com>
++
++	* libspi/collection.c: (match_states_all_p), (match_states_any_p),
++	(match_roles_all_p), (match_roles_any_p), (match_roles_none_p),
++	(match_interfaces_all_p), (match_interfaces_any_p),
++	(match_interfaces_none_p), (match_attributes_all_p),
++	(match_attributes_any_p), (match_attributes_none_p),
++	(getMatchesFrom), (getMatchesInOrder), (getMatchesInBackOrder),
++	(getMatchesTo), (impl_getMatches):
++	Bug #527585. Fix memory leak and swapped order of some checks so that
++	a NULL pointer is checked for before attempting to read from it.
++	Patch from Mike Gorse.
++
+ 2008-09-22  Li Yuan  <li.yuan at sun.com>
+ 
+ 	* NEWS:
+diff -ru at-spi-1.24.0.orig/atk-bridge/bridge.c at-spi-1.24.0/atk-bridge/bridge.c
+--- at-spi-1.24.0.orig/atk-bridge/bridge.c	2008-09-22 10:19:40.000000000 +0200
++++ at-spi-1.24.0/atk-bridge/bridge.c	2008-11-02 18:00:04.000000000 +0100
+@@ -470,7 +470,7 @@
+ 
+   if (BONOBO_EX (&ev))
+     {
+-      g_warning (_("failure: no device event controller found.\n"));
++      DBG (1, g_warning (_("failure: no device event controller found.\n")));
+       registry_died = TRUE;
+       device_event_controller = CORBA_OBJECT_NIL;
+     }
+diff -ru at-spi-1.24.0.orig/cspi/bonobo/cspi-bonobo.c at-spi-1.24.0/cspi/bonobo/cspi-bonobo.c
+--- at-spi-1.24.0.orig/cspi/bonobo/cspi-bonobo.c	2008-07-21 09:18:04.000000000 +0200
++++ at-spi-1.24.0/cspi/bonobo/cspi-bonobo.c	2008-11-02 18:00:04.000000000 +0100
+@@ -161,6 +161,7 @@
+     {
+       registry = CORBA_ORB_string_to_object (bonobo_activation_orb_get (),
+ 			  			 ior, &ev);
++      XFree (ior);
+     }
+ 
+   if (ev._major != CORBA_NO_EXCEPTION)
+diff -ru at-spi-1.24.0.orig/libspi/accessible.c at-spi-1.24.0/libspi/accessible.c
+--- at-spi-1.24.0.orig/libspi/accessible.c	2008-07-21 09:18:02.000000000 +0200
++++ at-spi-1.24.0/libspi/accessible.c	2008-11-02 18:00:04.000000000 +0100
+@@ -461,6 +461,7 @@
+     gint i;
+     
+     AtkObject *object = get_atkobject_from_servant (servant);
++    gchar *concat_str;
+     
+     g_return_val_if_fail (object != NULL, NULL);
+     attributes = atk_object_get_attributes (object);
+@@ -476,7 +477,9 @@
+     for (i = 0; i < n_attributes; ++i)
+     {
+ 	attr = g_slist_nth_data (attributes, i);
+-	retval->_buffer[i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL));
++	concat_str = g_strconcat (attr->name, ":", attr->value, NULL);
++	retval->_buffer[i] = CORBA_string_dup (concat_str);
++	g_free (concat_str);
+     }
+ 
+     atk_attribute_set_free (attributes);
+diff -ru at-spi-1.24.0.orig/libspi/collection.c at-spi-1.24.0/libspi/collection.c
+--- at-spi-1.24.0.orig/libspi/collection.c	2008-07-21 09:18:02.000000000 +0200
++++ at-spi-1.24.0/libspi/collection.c	2008-11-02 18:00:04.000000000 +0100
+@@ -178,7 +178,7 @@
+      Accessibility_StateSeq *seq = Accessibility_StateSet_getStates (set, ev); 
+      gint i;
+ 
+-     if (seq->_length == 0 || seq == NULL)
++     if (seq == NULL || seq->_length == 0)
+ 	  return TRUE;
+ 
+      chs = Accessibility_Accessible_getState (child, ev);
+@@ -199,7 +199,7 @@
+      Accessibility_StateSeq *seq = Accessibility_StateSet_getStates (set, ev);
+      gint i;
+ 
+-     if (seq->_length == 0 || seq == NULL)
++     if (seq == NULL || seq->_length == 0)
+ 	  return TRUE;
+ 
+      chs = Accessibility_Accessible_getState (child, ev);
+@@ -265,10 +265,10 @@
+ 
+    Accessibility_Role role; 
+ 
+-     if (roles->_length > 1) 
+-	  return FALSE;
+-     else if (roles->_length == 0 || roles == NULL)
++     if (roles == NULL || roles->_length == 0)
+ 	  return TRUE;
++     else if (roles->_length > 1) 
++	  return FALSE;
+ 
+      role  = Accessibility_Accessible_getRole (child, ev);
+ 
+@@ -287,7 +287,7 @@
+      Accessibility_Role role; 
+      int i;
+ 
+-     if (roles->_length == 0 || roles == NULL)
++     if (roles == NULL || roles->_length == 0)
+ 	  return TRUE;
+ 
+      role =  Accessibility_Accessible_getRole (child, ev);
+@@ -307,7 +307,7 @@
+   Accessibility_Role role ; 
+      int i;
+ 
+-     if (roles->_length == 0 || roles == NULL)
++     if (roles == NULL || roles->_length == 0)
+ 	  return TRUE;
+ 
+      role =  Accessibility_Accessible_getRole (child, ev);
+@@ -363,9 +363,10 @@
+ 
+      for (i = 0; i < length; i++)
+        if (!child_interface_p (obj, ifaces [i], ev)){
+-	    g_free (ifaces);
++	    g_strfreev (ifaces);
+ 	       return FALSE;
+        }
++     g_strfreev(ifaces);
+      return TRUE;
+ }
+ 
+@@ -384,9 +385,10 @@
+ 
+      for (i = 0; i < length; i++)
+        if (child_interface_p (obj, ifaces [i], ev)){
+-	        g_free (ifaces);
++	        g_strfreev (ifaces);
+ 		return TRUE;
+        }
++     g_strfreev(ifaces);
+      return FALSE;
+ }
+ 
+@@ -402,9 +404,12 @@
+ 	  return TRUE;
+ 
+      for (i = 0; i < length; i++)
+-	   if (child_interface_p (obj, ifaces [i], ev))
++	   if (child_interface_p (obj, ifaces [i], ev)){
++		g_strfreev(ifaces);
+ 		return FALSE;
++	   }
+      
++     g_strfreev(ifaces);
+      return TRUE;
+ }
+ 
+@@ -447,7 +452,7 @@
+      Accessibility_AttributeSet *oa ;
+      gboolean flag = FALSE;
+ 
+-     if (attributes->_length == 0 || attributes == NULL)
++     if (attributes == NULL || attributes->_length == 0)
+ 	  return TRUE;
+      
+      oa =  Accessibility_Accessible_getAttributes (child, ev);
+@@ -476,7 +481,7 @@
+ 
+      Accessibility_AttributeSet *oa;
+ 
+-     if (attributes->_length == 0 || attributes == NULL)
++     if (attributes == NULL || attributes->_length == 0)
+ 	  return TRUE;
+ 
+      oa =  Accessibility_Accessible_getAttributes (child, ev);
+@@ -497,7 +502,7 @@
+      int i, k;
+      Accessibility_AttributeSet *oa;
+ 
+-     if (attributes->_length == 0 || attributes == NULL)
++     if (attributes == NULL || attributes->_length == 0)
+ 	  return TRUE;
+ 
+      oa =  Accessibility_Accessible_getAttributes (child, ev);
+@@ -712,7 +717,7 @@
+      glong index = 
+            Accessibility_Accessible_getIndexInParent (current_object, ev);
+      gint kount = 0;
+-
++     Accessibility_AccessibleSet *retval;
+      ls = g_list_append (ls, current_object);
+      mrp =  get_collection_from_servant (servant)->_mrp;;
+           
+@@ -726,12 +731,14 @@
+                               current_object, 0, FALSE, CORBA_OBJECT_NIL, 
+                               TRUE, traverse, ev);
+ 
+-     ls = g_list_next (ls); 
++     ls = g_list_remove(ls, g_list_nth_data(ls, 0));
+ 
+      if (sortby == Accessibility_Collection_SORT_ORDER_REVERSE_CANONICAL)
+        ls = g_list_reverse (ls);
+  
+-     return  _accessible_list_to_set (ls, kount);
++     retval = _accessible_list_to_set (ls, kount);
++     g_list_free(ls);
++     return retval;
+ }
+ 
+ /*
+@@ -793,6 +800,7 @@
+   Accessibility_Accessible obj;
+   MatchRulePrivate *mrp;
+   gint kount = 0;
++  Accessibility_AccessibleSet *retval;
+ 
+   ls = g_list_append (ls, current_object);
+   mrp = get_collection_from_servant (servant)->_mrp;
+@@ -803,12 +811,14 @@
+   kount = inorder (obj, mrp, ls, 0, count, 
+                    current_object, TRUE, CORBA_OBJECT_NIL, traverse, ev);
+ 
+-  ls = g_list_next (ls);
++  ls = g_list_remove(ls, g_list_nth_data(ls, 0));
+ 
+   if (sortby == Accessibility_Collection_SORT_ORDER_REVERSE_CANONICAL)
+     ls = g_list_reverse (ls);
+ 
+-  return _accessible_list_to_set (ls, kount); 
++  retval = _accessible_list_to_set (ls, kount); 
++  g_list_free(ls);
++  return retval;
+ }
+ 
+ /*
+@@ -827,6 +837,7 @@
+   Accessibility_Accessible collection;
+   MatchRulePrivate *mrp;
+   gint kount = 0;
++  Accessibility_AccessibleSet *retval;
+ 
+   ls = g_list_append (ls, current_object);
+   mrp = get_collection_from_servant (servant)->_mrp;
+@@ -837,12 +848,14 @@
+   kount = sort_order_rev_canonical (mrp, ls, 0, count, current_object, 
+                                    FALSE, collection, ev);
+ 
+-  ls = g_list_next (ls);
++  ls = g_list_remove(ls, g_list_nth_data(ls, 0));
+ 
+   if (sortby == Accessibility_Collection_SORT_ORDER_REVERSE_CANONICAL)
+     ls = g_list_reverse (ls);
+ 
+-  return _accessible_list_to_set (ls, kount); 
++  retval = _accessible_list_to_set (ls, kount); 
++  g_list_free(ls);
++  return retval;
+ }
+ 
+ 
+@@ -862,6 +875,7 @@
+   Accessibility_Accessible obj;
+   MatchRulePrivate *mrp;
+   gint kount = 0;
++  Accessibility_AccessibleSet *retval;
+ 
+   ls = g_list_append (ls, current_object); 
+   mrp =  get_collection_from_servant (servant)->_mrp;
+@@ -879,13 +893,14 @@
+ 
+   }
+ 
+-  ls = g_list_next (ls); 
++  ls = g_list_remove(ls, g_list_nth_data(ls, 0));
+    
+   if (sortby != Accessibility_Collection_SORT_ORDER_REVERSE_CANONICAL)
+     ls = g_list_reverse (ls);
+ 
+-  return  _accessible_list_to_set (ls, kount);
+-  
++  retval = _accessible_list_to_set (ls, kount);
++  g_list_free(ls);
++  return retval;
+ }
+ 
+ static Accessibility_AccessibleSet *
+@@ -955,6 +970,7 @@
+      Accessibility_Accessible obj;
+      MatchRulePrivate *mrp;
+      gint kount = 0;
++     Accessibility_AccessibleSet *retval;
+     
+      obj = spi_accessible_new_return (aobj, FALSE, ev);
+      ls = g_list_prepend (ls, obj); 
+@@ -963,12 +979,14 @@
+      kount = query_exec (mrp,  sortby, ls, 0, count, 
+                          obj, 0, TRUE, CORBA_OBJECT_NIL, TRUE, traverse, ev); 
+ 
+-     ls = g_list_next (ls); 
++     ls = g_list_remove(ls, g_list_nth_data(ls, 0));
+     
+      if (sortby == Accessibility_Collection_SORT_ORDER_REVERSE_CANONICAL)
+        ls = g_list_reverse (ls);
+ 
+-     return  _accessible_list_to_set (ls, kount);
++     retval = _accessible_list_to_set (ls, kount);
++     g_list_free(ls);
++     return retval;
+ }
+ 
+ static void
+diff -ru at-spi-1.24.0.orig/libspi/document.c at-spi-1.24.0/libspi/document.c
+--- at-spi-1.24.0.orig/libspi/document.c	2008-07-21 09:18:02.000000000 +0200
++++ at-spi-1.24.0/libspi/document.c	2008-11-02 18:00:04.000000000 +0100
+@@ -101,6 +101,7 @@
+   Accessibility_AttributeSet *retval;
+   gint n_attributes = 0;
+   gint i;
++  gchar *concat_str;
+   
+   g_return_val_if_fail (document != NULL, NULL);
+   
+@@ -120,7 +121,9 @@
+   for (i = 0; i < n_attributes; ++i)
+   {
+       attr = g_slist_nth_data (attributes, i);
+-      retval->_buffer [i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL));
++      concat_str = g_strconcat (attr->name, ":", attr->value, NULL);
++      retval->_buffer [i] = CORBA_string_dup (concat_str);
++      g_free (concat_str);
+   }
+     
+   atk_attribute_set_free (attributes);
+diff -ru at-spi-1.24.0.orig/libspi/text.c at-spi-1.24.0/libspi/text.c
+--- at-spi-1.24.0.orig/libspi/text.c	2008-07-21 09:18:02.000000000 +0200
++++ at-spi-1.24.0/libspi/text.c	2008-11-02 18:00:04.000000000 +0100
+@@ -547,6 +547,7 @@
+      AtkText *text = get_text_from_servant (servant);
+      gint n_attributes = 0, total_attributes = 0, n_default_attributes = 0;
+      gint i, j;
++     gchar *concat_str;
+      
+      g_return_val_if_fail (text != NULL, NULL);
+ 
+@@ -576,13 +577,17 @@
+ 	 for (i = 0; i < n_attributes; ++i)
+ 	 {
+ 	     attr = g_slist_nth_data (attributes, i);
+-	     retval->_buffer[i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL));
++             concat_str = g_strconcat (attr->name, ":", attr->value, NULL);
++	     retval->_buffer[i] = CORBA_string_dup (concat_str);
++	     g_free (concat_str);
+ 	 }
+ 	 
+ 	 for (j = 0; j < n_default_attributes; ++i, ++j)
+ 	 {
+ 	     attr = g_slist_nth_data (default_attributes, j);
+-	     retval->_buffer[i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL));
++	     concat_str = g_strconcat (attr->name, ":", attr->value, NULL);
++	     retval->_buffer[i] = CORBA_string_dup (concat_str);
++	     g_free(concat_str);
+ 	 }
+ 	 
+ 	 atk_attribute_set_free (attributes);
+@@ -601,6 +606,7 @@
+      AtkText *text = get_text_from_servant (servant);
+      gint n_attributes = 0;
+      gint i;
++     gchar *concat_str;
+      
+      g_return_val_if_fail (text != NULL, NULL);
+      
+@@ -618,7 +624,9 @@
+ 	 for (i = 0; i < n_attributes; ++i)
+ 	 {
+ 	     attr = g_slist_nth_data (attributes, i);
+-	     retval->_buffer [i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL));
++	     concat_str = g_strconcat (attr->name, ":", attr->value, NULL);
++	     retval->_buffer [i] = CORBA_string_dup (concat_str);
++	     g_free (concat_str);
+ 	 }
+ 	 atk_attribute_set_free (attributes);
+      }     




More information about the pkg-gnome-commits mailing list