diff options
author | Karel Zak <kzak@redhat.com> | 2014-09-26 11:23:32 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2014-10-24 10:22:50 +0200 |
commit | 8083886768020a0235df2a267c02ecbd83c05f72 (patch) | |
tree | 11baf3a6b9430b5259220e2da705bc150563b10f | |
parent | 65cb3803e98cb8bb579da49660f0b8d340c62766 (diff) | |
download | util-linux-8083886768020a0235df2a267c02ecbd83c05f72.tar.gz |
lslogins: cleanup after error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | login-utils/lslogins.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index 91831831a..4503fe5d4 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -1064,13 +1064,13 @@ static void print_journal_tail(const char *journal_path, uid_t uid, size_t len) do { if (0 > sd_journal_get_data(j, "SYSLOG_IDENTIFIER", (const void **) &identifier, &identifier_len)) - return; + goto done; if (0 > sd_journal_get_data(j, "_PID", (const void **) &pid, &pid_len)) - return; + goto done; if (0 > sd_journal_get_data(j, "MESSAGE", (const void **) &message, &message_len)) - return; + goto done; sd_journal_get_realtime_usec(j, &x); t = x / 1000000; @@ -1087,6 +1087,7 @@ static void print_journal_tail(const char *journal_path, uid_t uid, size_t len) fprintf(stdout, "%s\n", message); } while (sd_journal_next(j)); +done: free(buf); free(match); sd_journal_flush_matches(j); |