dcavalca / rpms / systemd

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