[login-utils/login.c:510]: (error) Resource leak: fd Signed-off-by: Sami Kerola <kerolasa@xxxxxx> --- login-utils/login.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/login-utils/login.c b/login-utils/login.c index a17083b..4250534 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -506,8 +506,10 @@ static void log_lastlog(struct login_context *cxt) if (fd < 0) return; - if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1) + if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1) { + close(fd); return; + } /* * Print last log message -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html