diff --git a/src/util/fossilize_db.c b/src/util/fossilize_db.c index b77d7bcfa9b..0d26cb00cae 100644 --- a/src/util/fossilize_db.c +++ b/src/util/fossilize_db.c @@ -362,14 +362,14 @@ foz_read_entry(struct foz_db *foz_db, const uint8_t *cache_key_160bit, goto fail; } + /* Reset file offset to the end of the file ready for writing */ + fseek(foz_db->file[file_idx], offset, SEEK_SET); + simple_mtx_unlock(&foz_db->mtx); if (size) *size = data_sz; - /* Reset file offset to the end of the file ready for writing */ - fseek(foz_db->file[file_idx], offset, SEEK_SET); - return data; fail: