loginrec close fd on error path

This commit is contained in:
Matt Johnston 2018-02-17 12:16:18 +08:00
parent f042eb41ab
commit c8d852caf6

View File

@ -1330,7 +1330,8 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
if ( lseek(*fd, offset, SEEK_SET) != offset ) {
dropbear_log(LOG_WARNING, "lastlog_openseek: %s->lseek(): %s",
lastlog_file, strerror(errno));
lastlog_file, strerror(errno));
m_close(*fd);
return 0;
}
}