naccyde / rpms / systemd

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