summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-control.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-05 10:19:12 +0200
committerGitHub <noreply@github.com>2018-04-05 10:19:12 +0200
commitba45959cb2b6e2476a2ad207b6609ce5fa8412b0 (patch)
treeec4a63d91dcb18532b9e1513b7d9d7d2fdc2dcbe /src/libsystemd/sd-bus/bus-control.c
parentc0f9017c1195b9bc3743e8dd000a18d3898b0034 (diff)
parent0dfb0a0abd98f8726a39f26e4d737f47ec0fd53b (diff)
downloadsystemd-ba45959cb2b6e2476a2ad207b6609ce5fa8412b0.tar.gz
Merge pull request #8656 from yuwata/random-fixes
use TAKE_PTR() and TAKE_FD() macros, and small fixes
Diffstat (limited to 'src/libsystemd/sd-bus/bus-control.c')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 9dd5274bf6..50f2b3fc1a 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -431,14 +431,11 @@ _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatabl
if (r < 0)
return r;
- *activatable = y;
- y = NULL;
+ *activatable = TAKE_PTR(y);
}
- if (acquired) {
- *acquired = x;
- x = NULL;
- }
+ if (acquired)
+ *acquired = TAKE_PTR(x);
return 0;
}
@@ -734,10 +731,8 @@ _public_ int sd_bus_get_name_creds(
return r;
}
- if (creds) {
- *creds = c;
- c = NULL;
- }
+ if (creds)
+ *creds = TAKE_PTR(c);
return 0;
}
@@ -810,8 +805,8 @@ _public_ int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **r
if (r < 0)
return r;
- *ret = c;
- c = NULL;
+ *ret = TAKE_PTR(c);
+
return 0;
}