ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From 4cbe0933587385ed0d811ce11264d65d15b05cfd Mon Sep 17 00:00:00 2001
923a60
From: Lennart Poettering <lennart@poettering.net>
923a60
Date: Mon, 18 May 2015 23:54:05 +0200
923a60
Subject: [PATCH] journalctl: free all command line argument objects
923a60
923a60
let's try to be valgrind clean
923a60
923a60
Cherry-picked from: d52da2057f06c49d50ed99300dc407c0227b1a32
923a60
Related: #1318994
923a60
---
923a60
 src/journal/journalctl.c | 8 ++++----
923a60
 1 file changed, 4 insertions(+), 4 deletions(-)
923a60
923a60
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
923a60
index 31da357c1b..92ee3fb27d 100644
923a60
--- a/src/journal/journalctl.c
923a60
+++ b/src/journal/journalctl.c
923a60
@@ -39,7 +39,6 @@
923a60
 
923a60
 #include "sd-journal.h"
923a60
 #include "sd-bus.h"
923a60
-
923a60
 #include "log.h"
923a60
 #include "logs-show.h"
923a60
 #include "util.h"
923a60
@@ -2003,9 +2002,6 @@ int main(int argc, char *argv[]) {
923a60
                 goto finish;
923a60
 
923a60
         r = add_units(j);
923a60
-        strv_free(arg_system_units);
923a60
-        strv_free(arg_user_units);
923a60
-
923a60
         if (r < 0) {
923a60
                 log_error_errno(r, "Failed to add filter for units: %m");
923a60
                 goto finish;
923a60
@@ -2283,5 +2279,9 @@ finish:
923a60
 
923a60
         strv_free(arg_file);
923a60
 
923a60
+        strv_free(arg_syslog_identifier);
923a60
+        strv_free(arg_system_units);
923a60
+        strv_free(arg_user_units);
923a60
+
923a60
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
923a60
 }