diff options
author | Karel Zak | 2014-09-26 11:23:32 +0200 |
---|---|---|
committer | Karel Zak | 2014-09-26 11:23:32 +0200 |
commit | 30ea015b87f79eb83e75c27dfcda890e3b8e7e83 (patch) | |
tree | e227498e5d8e51ab98c1f6fee0cd006eb8a5b981 /login-utils/lslogins.c | |
parent | mount: improve --move docs (diff) | |
download | kernel-qcow2-util-linux-30ea015b87f79eb83e75c27dfcda890e3b8e7e83.tar.gz kernel-qcow2-util-linux-30ea015b87f79eb83e75c27dfcda890e3b8e7e83.tar.xz kernel-qcow2-util-linux-30ea015b87f79eb83e75c27dfcda890e3b8e7e83.zip |
lslogins: cleanup after error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/lslogins.c')
-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); |