diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-31 22:35:54 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-01-02 19:45:48 -0500 |
commit | 5ce70e5bcd62e89b52485961c3699312ee4a7e0e (patch) | |
tree | 3cfa1d90fb492d5b71a38b4a8d57fe8bc5674416 /src/core/dbus-execute.c | |
parent | ac6b760ceedd4b21921b6a682cf1479af3d3024f (diff) |
Introduce cleanup functions for cap_free
Unfortunately a different cleanup function is necessary per type,
because cap_t** and char** are incompatible with void**.
Diffstat (limited to 'src/core/dbus-execute.c')
-rw-r--r-- | src/core/dbus-execute.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index b79a456455..4e9529708d 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -29,6 +29,7 @@ #include "fileio.h" #include "execute.h" #include "dbus-execute.h" +#include "capability.h" BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput); @@ -319,9 +320,8 @@ static int property_get_capabilities( sd_bus_error *error) { ExecContext *c = userdata; - char *t = NULL; + _cleanup_cap_free_charp_ char *t = NULL; const char *s; - int r; assert(bus); assert(reply); @@ -335,12 +335,7 @@ static int property_get_capabilities( if (!s) return -ENOMEM; - r = sd_bus_message_append(reply, "s", s); - - if (t) - cap_free(t); - - return r; + return sd_bus_message_append(reply, "s", s); } static int property_get_syscall_filter( |