diff -up usbguard-1.0.0/src/DBus/DBusBridge.cpp.orig usbguard-1.0.0/src/DBus/DBusBridge.cpp --- usbguard-1.0.0/src/DBus/DBusBridge.cpp.orig 2022-10-18 10:33:04.498762878 +0200 +++ usbguard-1.0.0/src/DBus/DBusBridge.cpp 2022-10-18 10:33:36.920785285 +0200 @@ -434,12 +434,11 @@ namespace usbguard USBGUARD_LOG(Trace) << "Connecting with Polkit authority..."; PolkitAuthority* const authority = polkit_authority_get_sync(/*cancellable=*/ NULL, &error); - if (! authority || error) { + if (! authority) { USBGUARD_LOG(Trace) << "Failed to connect to Polkit authority: " << formatGError(error) << "."; *authErrorCode = G_DBUS_ERROR_AUTH_FAILED; *authErrorMessage = "Failed to connect to Polkit authority"; g_error_free(error); - g_object_unref(authority); g_object_unref(subject); return false; } @@ -470,12 +469,11 @@ namespace usbguard /*cancellable=*/ NULL, &error); - if (! result || error) { + if (! result) { USBGUARD_LOG(Trace) << "Failed to check back with Polkit for authoriation: " << formatGError(error) << "."; *authErrorCode = G_DBUS_ERROR_AUTH_FAILED; *authErrorMessage = "Failed to check back with Polkit for authoriation."; g_error_free(error); - g_object_unref(result); g_object_unref(details); g_object_unref(authority); g_object_unref(subject);