chiark / gitweb /
Introduce cleanup functions for cap_free
[elogind.git] / src / libsystemd-bus / bus-dump.c
index df7cf6893a1aad35b4184900613676f236d5d27e..78e7597ed540bca227f9fb752b2be0e6e485f4be 100644 (file)
@@ -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++;
                 }