Fix crashes in atk_bridge_adaptor_cleanup
authorMike Gorse <mgorse@suse.com>
Thu, 20 Sep 2012 18:26:12 +0000 (13:26 -0500)
committerMike Gorse <mgorse@suse.com>
Thu, 20 Sep 2012 18:26:12 +0000 (13:26 -0500)
When freeing data, atk_bridge_adaptor_cleanup frees the wrong pointer,
resulting in a crash. Also, we need to close D-Bus connections before
removing the last reference, or libdbus will abort.

https://bugzilla.gnome.org/show_bug.cgi?id=684434

atk-adaptor/bridge.c

index 99a6a36..74f0431 100644 (file)
@@ -963,13 +963,14 @@ atk_bridge_adaptor_cleanup (void)
 
       droute_context_unregister (spi_global_app_data->droute, connection);
       droute_unintercept_dbus (connection);
+      dbus_connection_close (connection);
       dbus_connection_unref (connection);
     }
   g_list_free (spi_global_app_data->direct_connections);
   spi_global_app_data->direct_connections = NULL;
 
   for (ls = clients; ls; ls = ls->next)
-    g_free (l->data);
+    g_free (ls->data);
   g_slist_free (clients);
   clients = NULL;