1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Fix dereferencing freed pointer. Closes #7420.

The torrent is removed from session after `deleteTorrent()`
yet we still invoke `torrent->name()`, thus result in crash.
This commit is contained in:
Chocobo1 2017-09-11 13:11:09 +08:00
parent 467ba380b2
commit 855772ae5a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -1724,8 +1724,8 @@ void Session::processShareLimits()
if ((ratio <= TorrentHandle::MAX_RATIO) && (ratio >= ratioLimit)) {
Logger* const logger = Logger::instance();
if (m_maxRatioAction == Remove) {
deleteTorrent(torrent->hash());
logger->addMessage(tr("'%1' reached the maximum ratio you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
}
else if (!torrent->isPaused()) {
torrent->pause();
@ -1748,8 +1748,8 @@ void Session::processShareLimits()
if ((seedingTimeInMinutes <= TorrentHandle::MAX_SEEDING_TIME) && (seedingTimeInMinutes >= seedingTimeLimit)) {
Logger* const logger = Logger::instance();
if (m_maxRatioAction == Remove) {
deleteTorrent(torrent->hash());
logger->addMessage(tr("'%1' reached the maximum seeding time you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
}
else if (!torrent->isPaused()) {
torrent->pause();