Skip to content

Commit

Permalink
sysroot: Silence clang-analyzer warning
Browse files Browse the repository at this point in the history
I think this is another case of clang-analyzer not understanding
the "GError rules"; it's getting confused by the `NULL` checks here
and thinking that if `authority == NULL` it's possible `error == NULL`
too.  But it can't see into the implementation of libpolkit.
  • Loading branch information
cgwalters committed Aug 29, 2023
1 parent f297cda commit 571e21e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/daemon/rpmostreed-os.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ os_authorize_method (GDBusInterfaceSkeleton *interface, GDBusMethodInvocation *i
= rpmostreed_sysroot_get_polkit_authority (sysroot, &local_error);
if (!authority)
{
g_assert (local_error);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
"Failed to load polkit: %s", local_error->message);
return FALSE;
Expand Down
1 change: 1 addition & 0 deletions src/daemon/rpmostreed-sysroot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ sysroot_authorize_method (GDBusInterfaceSkeleton *interface, GDBusMethodInvocati
= rpmostreed_sysroot_get_polkit_authority (self, &local_error);
if (!authority)
{
g_assert (local_error);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
"Failed to load polkit: %s", local_error->message);
return FALSE;
Expand Down

0 comments on commit 571e21e

Please sign in to comment.