diff options
Diffstat (limited to 'dbus/dbus-auth.c')
-rw-r--r-- | dbus/dbus-auth.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index 660dc435..ffa20373 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -1668,14 +1668,22 @@ record_mechanisms (DBusAuth *auth, * it lists things in that order anyhow. */ - _dbus_verbose ("%s: Adding mechanism %s to list we will try\n", - DBUS_AUTH_NAME (auth), mech->mechanism); + if (mech != &all_mechanisms[0]) + { + _dbus_verbose ("%s: Adding mechanism %s to list we will try\n", + DBUS_AUTH_NAME (auth), mech->mechanism); - if (!_dbus_list_append (& DBUS_AUTH_CLIENT (auth)->mechs_to_try, - (void*) mech)) + if (!_dbus_list_append (& DBUS_AUTH_CLIENT (auth)->mechs_to_try, + (void*) mech)) + { + _dbus_string_free (&m); + goto nomem; + } + } + else { - _dbus_string_free (&m); - goto nomem; + _dbus_verbose ("%s: Already tried mechanism %s; not adding to list we will try\n", + DBUS_AUTH_NAME (auth), mech->mechanism); } } else |