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