ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From c95edddeb70a48202a0baf7b71450be87d2d921c Mon Sep 17 00:00:00 2001
923a60
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
923a60
Date: Tue, 12 Apr 2016 23:36:37 -0400
923a60
Subject: [PATCH] shared/logs-show: fix memleak in add_matches_for_unit
923a60
923a60
Cherry-picked from: 42fbdf45864b46f3eb62a3738b81e687685eb9bd
923a60
Related: #1331667
923a60
---
923a60
 src/shared/logs-show.c | 2 +-
923a60
 1 file changed, 1 insertion(+), 1 deletion(-)
923a60
923a60
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
923a60
index c2495056d7..8c374116ad 100644
923a60
--- a/src/shared/logs-show.c
923a60
+++ b/src/shared/logs-show.c
923a60
@@ -1060,7 +1060,7 @@ int add_matches_for_unit(sd_journal *j, const char *unit) {
923a60
         );
923a60
 
923a60
         if (r == 0 && endswith(unit, ".slice")) {
923a60
-                char *m5 = strappend("_SYSTEMD_SLICE=", unit);
923a60
+                const char *m5 = strjoina("_SYSTEMD_SLICE=", unit);
923a60
 
923a60
                 /* Show all messages belonging to a slice */
923a60
                 (void)(