1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 17:47:37 +00:00

(trunk libT) #3566 "Memory leak in libtransmission/torrent.c: refreshCurrentDir()" -- fixed.

This commit is contained in:
Charles Kerr 2010-09-18 21:57:22 +00:00
parent a46738b3ca
commit c7ebb37876

View file

@ -2962,13 +2962,12 @@ static void
refreshCurrentDir( tr_torrent * tor ) refreshCurrentDir( tr_torrent * tor )
{ {
const char * dir = NULL; const char * dir = NULL;
char * sub;
if( tor->incompleteDir == NULL ) if( tor->incompleteDir == NULL )
dir = tor->downloadDir; dir = tor->downloadDir;
else if( !tr_torrentHasMetadata( tor ) ) /* no files to find */ else if( !tr_torrentHasMetadata( tor ) ) /* no files to find */
dir = tor->incompleteDir; dir = tor->incompleteDir;
else if( !tr_torrentFindFile2( tor, 0, &dir, &sub ) ) else if( !tr_torrentFindFile2( tor, 0, &dir, NULL ) )
dir = tor->incompleteDir; dir = tor->incompleteDir;
assert( dir != NULL ); assert( dir != NULL );