systemd/SOURCES/0142-journald-free-the-allocated-memory-before-returning-.patch

29 lines
876 B
Diff
Raw Permalink Normal View History

2021-04-06 13:35:55 +00:00
From d8600cb5319060f294049a81320f5de4c48cf5d5 Mon Sep 17 00:00:00 2001
From: Evgeny Vereshchagin <evvers@ya.ru>
Date: Fri, 10 Aug 2018 12:52:07 +0000
Subject: [PATCH] journald: free the allocated memory before returning from
dev_kmsg_record
This fixes a minor memory leak.
(cherry picked from commit 30eddcd51b8a472e05d3b8d1f0b89fbd3e094d71)
Resolves: #1696224
---
src/journal/journald-kmsg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 7ad673362a..7644bebfc8 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -191,7 +191,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
e = memchr(k, '\n', l);
if (!e)
- return;
+ goto finish;
*e = 0;