fix NULL-pointer-dereference regression introduced in r13546 for #5069.

This commit is contained in:
Jordan Lee 2012-10-13 17:32:23 +00:00
parent 6755e4e24f
commit e1e254d8c2
1 changed files with 6 additions and 3 deletions

View File

@ -80,9 +80,12 @@ webseed_free( struct tr_webseed * w )
const tr_info * inf = tr_torrentInfo( tor );
tr_file_index_t i;
for( i=0; i<inf->fileCount; ++i )
tr_free( w->file_urls[i] );
tr_free( w->file_urls );
/* if we have an array of file URLs, free it */
if( w->file_urls != NULL ) {
for( i=0; i<inf->fileCount; ++i )
tr_free( w->file_urls[i] );
tr_free( w->file_urls );
}
/* webseed destruct */
event_free( w->timer );