From ed12ddb090f2ab65b8ba7247f497b7b201bf9513 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 10 Nov 2014 01:39:14 +0000 Subject: [PATCH] fix infinite loop in deleteLocalData(). --- libtransmission/torrent.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index f5ae254a4..6df5687de 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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;