fix: edge case file leak if error while making torrent (#2560)

found by Coverity
This commit is contained in:
Charles Kerr 2022-02-01 01:11:13 -06:00 committed by GitHub
parent fdff2893b6
commit 329c4d80e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -318,7 +318,7 @@ static std::vector<std::byte> getHashInfo(tr_metainfo_builder* b)
b->my_errno = EIO;
tr_snprintf(b->errfile, sizeof(b->errfile), "error hashing piece %" PRIu32, b->pieceIndex);
b->result = TR_MAKEMETA_IO_READ;
return {};
break;
}
walk = std::copy(std::begin(*digest), std::end(*digest), walk);