lslogins: call close() for usable FD [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-11-25 14:02:11 +01:00
parent 665d79e793
commit 30e8df968f
1 changed files with 3 additions and 1 deletions

View File

@ -1654,7 +1654,9 @@ int main(int argc, char *argv[])
scols_unref_table(tb);
tdestroy(ctl->usertree, free_user);
close(ctl->lastlogin_fd);
if (ctl->lastlogin_fd >= 0)
close(ctl->lastlogin_fd);
free_ctl(ctl);
return EXIT_SUCCESS;