anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0321-shared-logs-show-fix-memleak-in-add_matches_for_unit.patch

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