db.go: clean up file descriptor on db.file.ReadAt fail

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
pull/89/head
Gyuho Lee 2018-03-17 17:00:29 -07:00
parent 818c231b78
commit 3130a60889
1 changed files with 1 additions and 0 deletions

1
db.go
View File

@ -239,6 +239,7 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
db.pageSize = int(m.pageSize)
}
} else {
_ = db.close()
return nil, ErrInvalid
}
}