summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 16:08:40 -0400
committerJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 16:08:40 -0400
commitca87b90981e88623589b7d1d42ce5bafcb644213 (patch)
treeba0f6c2128fa83c1b6675ba906d912ca738257d2 /dbus
parentb5818e619f6258cc6d530ee62e99bd019b6d069b (diff)
fix memleak due to autolaunch and recursive calls to _dbus_open_transport
* Patch from Sumit <sumitskj_20@yahoo.com>, comments added * dbus/dbus-transport.c(_dbus_transport_open): fix mem leak
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-transport.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index 313cd417..1e1fc97d 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -412,7 +412,22 @@ _dbus_transport_open (DBusAddressEntry *entry,
else
{
_DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
- transport->expected_guid = expected_guid;
+
+ /* In the case of autostart the initial guid is NULL
+ * and the autostart transport recursively calls
+ * _dbus_open_transport wich returns a transport
+ * with a guid. That guid is the definitive one.
+ *
+ * FIXME: if more transports are added they may have
+ * an effect on the expected_guid semantics (i.e.
+ * expected_guid and transport->expected_guid may
+ * both have values). This is very unlikely though
+ * we should either throw asserts here for those
+ * corner cases or refactor the code so it is
+ * clearer on what is expected and what is not
+ */
+ if(expected_guid)
+ transport->expected_guid = expected_guid;
}
return transport;