DBusTransport: don't copy DBusAuth's GUID to expected_guid
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 1 Feb 2011 12:27:39 +0000 (12:27 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 16 Feb 2011 14:47:08 +0000 (14:47 +0000)
commit2acfe412b6c63a4a08deb52e9395562ca47d1101
tree847e64ce2168e45c4852b662b89235f82e53dd3f
parentd9af45a1faea64f89fe6755fdac776d6166f7d22
DBusTransport: don't copy DBusAuth's GUID to expected_guid

There was previously a leak in _dbus_transport_get_is_authenticated, if
we hit OOM when copying the server's actual GUID. This would fail the
"SHA1 connection test" if _dbus_iterate was modified to allocate and free
one extra pointer per iteration.

Rather than adding OOM handling everywhere, if we avoid strdup'ing the
GUID, and just re-fetch the const string from the DBusAuth object on demand
instead, we go back to a situation where _dbus_transport_get_is_authenticated
can't fail.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126
dbus/dbus-transport.c