fix infinite loop in deleteLocalData().

This commit is contained in:
Jordan Lee 2014-11-10 01:39:14 +00:00
parent 0d49daf36d
commit ed12ddb090
1 changed files with 4 additions and 0 deletions

View File

@ -2887,6 +2887,10 @@ deleteLocalData (tr_torrent * tor, tr_fileFunc func)
PtrArrayCompareFunc vstrcmp = (PtrArrayCompareFunc)strcmp;
const char * const top = tor->currentDir;
/* don't try to delete local data if the directory's gone missing */
if (!tr_sys_path_exists (top, NULL))
return;
/* if it's a magnet link, there's nothing to move... */
if (!tr_torrentHasMetadata (tor))
return;