From 5d4f5a1cfcf6862426dc4bd113637b10bbfa8a54 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 1 Feb 2011 13:03:44 +0000 Subject: [PATCH] _dbus_transport_get_is_authenticated: don't leak if copying GUID fails This would fail the "SHA1 connection test" if _dbus_iterate is modified to allocate and free one extra pointer per iteration. The leak was one reference to the DBusConnection, on an unlikely OOM code path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126 --- dbus/dbus-transport.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index a078f7c..dc23451 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -748,8 +748,12 @@ _dbus_transport_get_is_authenticated (DBusTransport *transport) if (transport->expected_guid == NULL) { + /* Our auth object has authenticated, but we can't say we're + * authenticated until we've copied its GUID; fall + * through, so we'll behave the same as if the DBusAuth + * had said it wasn't ready. */ _dbus_verbose ("No memory to complete auth\n"); - return FALSE; + maybe_authenticated = FALSE; } } } -- 1.7.2.3