summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog6
-rw-r--r--dbus/dbus-transport.c17
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index edca8110..5f9f4df5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-04-03 John (J5) Palmieri <johnp@redhat.com>
+ Patch from Sumit <sumitskj_20@yahoo.com>, comments added
+
+ * dbus/dbus-transport.c(_dbus_transport_open): fix mem leak
+
+2008-04-03 John (J5) Palmieri <johnp@redhat.com>
+
* dbus/dbus-connection.c (dbus_connection_send): add documentation
to describe when to call dbus_connection_flush and
dbus_connection_unref after a call to dbus_connection_send is made
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;