diff options
author | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 12:16:18 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 12:16:18 +0800 |
commit | c8d852caf646d060babd4be9d074caee51c5aead (patch) | |
tree | d07a1c7b1e0ed6070d3c5169ab605fb5eafd065a | |
parent | f042eb41ab0d31f8ba0c5ccc9c848ad01f08f986 (diff) |
loginrec close fd on error path
-rw-r--r-- | loginrec.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } } |