summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-dump.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-31 22:35:54 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-02 19:45:48 -0500
commit5ce70e5bcd62e89b52485961c3699312ee4a7e0e (patch)
tree3cfa1d90fb492d5b71a38b4a8d57fe8bc5674416 /src/libsystemd-bus/bus-dump.c
parentac6b760ceedd4b21921b6a682cf1479af3d3024f (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/libsystemd-bus/bus-dump.c')
-rw-r--r--src/libsystemd-bus/bus-dump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-dump.c b/src/libsystemd-bus/bus-dump.c
index df7cf6893a..78e7597ed5 100644
--- a/src/libsystemd-bus/bus-dump.c
+++ b/src/libsystemd-bus/bus-dump.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/capability.h>
-
#include "util.h"
#include "capability.h"
#include "strv.h"
@@ -281,12 +279,15 @@ static void dump_capabilities(
for (;;) {
if (r > 0) {
+ _cleanup_cap_free_charp_ char *t;
+
if (n > 0)
fputc(' ', f);
if (n % 4 == 3)
fputs("\n ", f);
- fputs(cap_to_name(i), f);
+ t = cap_to_name(i);
+ fprintf(f, "%s", t);
n++;
}