Skip to content

Commit

Permalink
polkit: use structured initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering authored and keszybz committed Feb 4, 2020
1 parent 7f56982 commit f4425c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/shared/bus-polkit.c
Expand Up @@ -343,13 +343,15 @@ int bus_verify_polkit_async(
if (r < 0)
return r;

q = new0(AsyncPolkitQuery, 1);
q = new(AsyncPolkitQuery, 1);
if (!q)
return -ENOMEM;

q->request = sd_bus_message_ref(call);
q->callback = callback;
q->userdata = userdata;
*q = (AsyncPolkitQuery) {
.request = sd_bus_message_ref(call),
.callback = callback,
.userdata = userdata,
};

q->action = strdup(action);
if (!q->action) {
Expand Down

0 comments on commit f4425c7

Please sign in to comment.