mirror of
https://github.com/aria2/aria2.git
synced 2026-04-13 08:18:46 +00:00
2006-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/DefaultBtProgressInfoFile.cc (load): Fixed memory leak when the infohash doesn't match.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2006-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
* src/DefaultBtProgressInfoFile.cc
|
||||
(load): Fixed memory leak when the infohash doesn't match.
|
||||
|
||||
2006-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
* src/DefaultPeerStorage.cc
|
||||
|
||||
@@ -104,7 +104,7 @@ void DefaultBtProgressInfoFile::load() {
|
||||
}
|
||||
if(Util::toHex(savedInfoHash, btContext->getInfoHashLength()) !=
|
||||
btContext->getInfoHashAsString()) {
|
||||
throw new DlAbortEx("Incorrect infoHash.");
|
||||
throw string("infoHashMismatch");
|
||||
}
|
||||
if(fread(savedBitfield, pieceStorage->getBitfieldLength(), 1, file) < 1) {
|
||||
throw string("readError");
|
||||
@@ -136,8 +136,12 @@ void DefaultBtProgressInfoFile::load() {
|
||||
delete [] savedInfoHash;
|
||||
}
|
||||
fclose(file);
|
||||
throw new DlAbortEx(EX_SEGMENT_FILE_READ,
|
||||
filename.c_str(), strerror(errno));
|
||||
if(ex == "infoHashMismatch") {
|
||||
throw new DlAbortEx("The infoHash in torrent file doesn't match to one in .aria2 file.");
|
||||
} else {
|
||||
throw new DlAbortEx(EX_SEGMENT_FILE_READ,
|
||||
filename.c_str(), strerror(errno));
|
||||
}
|
||||
}
|
||||
logger->info(MSG_LOADED_SEGMENT_FILE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user