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
This commit is contained in:
John (J5) Palmieri 2008-04-03 16:08:40 -04:00
parent b5818e619f
commit ca87b90981
2 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,9 @@
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

View file

@ -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;