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