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/libsystemd-bus/bus-dump.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libsystemd-bus') 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 . ***/ -#include - #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++; } -- cgit v1.2.3-54-g00ecf