From 5ce70e5bcd62e89b52485961c3699312ee4a7e0e Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 31 Dec 2013 22:35:54 -0500 Subject: Introduce cleanup functions for cap_free Unfortunately a different cleanup function is necessary per type, because cap_t** and char** are incompatible with void**. --- src/core/dbus-execute.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core/dbus-execute.c') 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( -- cgit v1.2.3-54-g00ecf