Mercurial > dropbear
comparison loginrec.c @ 1513:c7675aa88880
loginrec close fd on error path
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 12:16:18 +0800 |
parents | 83d85b28b353 |
children |
comparison
equal
deleted
inserted
replaced
1508:47f36d8565cf | 1513:c7675aa88880 |
---|---|
1328 /* find this uid's offset in the lastlog file */ | 1328 /* find this uid's offset in the lastlog file */ |
1329 offset = (off_t) ((long)li->uid * sizeof(struct lastlog)); | 1329 offset = (off_t) ((long)li->uid * sizeof(struct lastlog)); |
1330 | 1330 |
1331 if ( lseek(*fd, offset, SEEK_SET) != offset ) { | 1331 if ( lseek(*fd, offset, SEEK_SET) != offset ) { |
1332 dropbear_log(LOG_WARNING, "lastlog_openseek: %s->lseek(): %s", | 1332 dropbear_log(LOG_WARNING, "lastlog_openseek: %s->lseek(): %s", |
1333 lastlog_file, strerror(errno)); | 1333 lastlog_file, strerror(errno)); |
1334 m_close(*fd); | |
1334 return 0; | 1335 return 0; |
1335 } | 1336 } |
1336 } | 1337 } |
1337 | 1338 |
1338 return 1; | 1339 return 1; |