summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-17 12:16:18 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-17 12:16:18 +0800
commit3b433447f9714eaae3010381cd2ff0b153d36818 (patch)
treedabd9f2a316e5b263463453e7eaae2365efa3dfc /loginrec.c
parent2b551518f8625f87a22ea1fde40e3c7d841bf9d0 (diff)
downloaddropbear-3b433447f9714eaae3010381cd2ff0b153d36818.tar.gz
loginrec close fd on error path
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loginrec.c b/loginrec.c
index 7254cf1..af10d95 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -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;
}
}