9fc0f6
From f1a8d50c069f57f0b9d23c81e50686bc8a2e43b7 Mon Sep 17 00:00:00 2001
9fc0f6
From: Lennart Poettering <lennart@poettering.net>
9fc0f6
Date: Tue, 10 Dec 2013 19:51:47 +0000
9fc0f6
Subject: [PATCH] journald: use a bit more cleanup magic!
9fc0f6
9fc0f6
---
9fc0f6
 src/journal/journald-stream.c | 8 +-------
9fc0f6
 1 file changed, 1 insertion(+), 7 deletions(-)
9fc0f6
9fc0f6
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
9fc0f6
index 4080622..771a2bd 100644
9fc0f6
--- a/src/journal/journald-stream.c
9fc0f6
+++ b/src/journal/journald-stream.c
9fc0f6
@@ -75,7 +75,7 @@ struct StdoutStream {
9fc0f6
 
9fc0f6
 static int stdout_stream_log(StdoutStream *s, const char *p) {
9fc0f6
         struct iovec iovec[N_IOVEC_META_FIELDS + 5];
9fc0f6
-        char *message = NULL, *syslog_priority = NULL, *syslog_facility = NULL, *syslog_identifier = NULL;
9fc0f6
+        _cleanup_free_ char *message = NULL, *syslog_priority = NULL, *syslog_facility = NULL, *syslog_identifier = NULL;
9fc0f6
         unsigned n = 0;
9fc0f6
         int priority;
9fc0f6
         char *label = NULL;
9fc0f6
@@ -128,12 +128,6 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
9fc0f6
 #endif
9fc0f6
 
9fc0f6
         server_dispatch_message(s->server, iovec, n, ELEMENTSOF(iovec), &s->ucred, NULL, label, label_len, s->unit_id, priority, 0);
9fc0f6
-
9fc0f6
-        free(message);
9fc0f6
-        free(syslog_priority);
9fc0f6
-        free(syslog_facility);
9fc0f6
-        free(syslog_identifier);
9fc0f6
-
9fc0f6
         return 0;
9fc0f6
 }
9fc0f6