]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
fix memleak due to autolaunch and recursive calls to _dbus_open_transport
authorJohn (J5) Palmieri <johnp@redhat.com>
Thu, 3 Apr 2008 20:08:40 +0000 (16:08 -0400)
committerJohn (J5) Palmieri <johnp@redhat.com>
Thu, 3 Apr 2008 20:08:40 +0000 (16:08 -0400)
* Patch from Sumit <sumitskj_20@yahoo.com>, comments added

* dbus/dbus-transport.c(_dbus_transport_open): fix mem leak

ChangeLog
dbus/dbus-transport.c

index edca81108efda617d4516492bbd5c2dc82607c67..5f9f4df5b001c495282c61a87b562e0265953c05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 313cd41768f05e7bc70a66ca3565f1e11608a5f7..1e1fc97d42379c5f13629aae202a2f6cc724224b 100644 (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;