mirror of https://github.com/aria2/aria2
2006-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/DefaultBtProgressInfoFile.cc (load): Fixed memory leak when the infohash doesn't match.pull/1/head
parent
c2686b1c50
commit
ff3ab41b18
|
@ -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>
|
2006-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
* src/DefaultPeerStorage.cc
|
* src/DefaultPeerStorage.cc
|
||||||
|
|
|
@ -104,7 +104,7 @@ void DefaultBtProgressInfoFile::load() {
|
||||||
}
|
}
|
||||||
if(Util::toHex(savedInfoHash, btContext->getInfoHashLength()) !=
|
if(Util::toHex(savedInfoHash, btContext->getInfoHashLength()) !=
|
||||||
btContext->getInfoHashAsString()) {
|
btContext->getInfoHashAsString()) {
|
||||||
throw new DlAbortEx("Incorrect infoHash.");
|
throw string("infoHashMismatch");
|
||||||
}
|
}
|
||||||
if(fread(savedBitfield, pieceStorage->getBitfieldLength(), 1, file) < 1) {
|
if(fread(savedBitfield, pieceStorage->getBitfieldLength(), 1, file) < 1) {
|
||||||
throw string("readError");
|
throw string("readError");
|
||||||
|
@ -136,8 +136,12 @@ void DefaultBtProgressInfoFile::load() {
|
||||||
delete [] savedInfoHash;
|
delete [] savedInfoHash;
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
throw new DlAbortEx(EX_SEGMENT_FILE_READ,
|
if(ex == "infoHashMismatch") {
|
||||||
filename.c_str(), strerror(errno));
|
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);
|
logger->info(MSG_LOADED_SEGMENT_FILE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue