summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-kmsg.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-08-10 14:52:07 +0200
committerEvgeny Vereshchagin <evvers@ya.ru>2018-08-10 15:35:06 +0200
commit30eddcd51b8a472e05d3b8d1f0b89fbd3e094d71 (patch)
tree8f9c1fcd1b3026d1365c58aff5049bc6ea3f86ee /src/journal/journald-kmsg.c
parentjournald: make it clear that dev_kmsg_record modifies the string passed to it (diff)
downloadsystemd-30eddcd51b8a472e05d3b8d1f0b89fbd3e094d71.tar.xz
systemd-30eddcd51b8a472e05d3b8d1f0b89fbd3e094d71.zip
journald: free the allocated memory before returning from dev_kmsg_record
This fixes a minor memory leak.
Diffstat (limited to 'src/journal/journald-kmsg.c')
-rw-r--r--src/journal/journald-kmsg.c2
1 files changed, 1 insertions, 1 deletions
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;