small memleaks

This commit is contained in:
Eric Petit 2007-01-20 05:07:00 +00:00
parent 93cb1c89ad
commit 15fdfda60f
2 changed files with 16 additions and 0 deletions

View File

@ -111,6 +111,7 @@ void tr_sharedClose( tr_shared_t * s )
tr_natpmpClose( s->natpmp );
tr_upnpClose( s->upnp );
tr_chokingClose( s->choking );
free( s );
}
/***********************************************************************

View File

@ -536,9 +536,24 @@ void tr_trackerStopped( tr_tracker_t * tc )
void tr_trackerClose( tr_tracker_t * tc )
{
tr_torrent_t * tor = tc->tor;
tr_info_t * inf = &tor->info;
tr_announce_list_ptr_t * cur, * curFree;
int ii;
killHttp( &tc->http, tor->fdlimit );
killHttp( &tc->httpScrape, tor->fdlimit );
for( ii = 0; ii < inf->trackerTiers; ii++ )
{
for( cur = tc->trackerAnnounceListPtr[ii]; cur; )
{
curFree = cur;
cur = cur->nextItem;
free( curFree );
}
}
free( tc->trackerAnnounceListPtr );
free( tc->trackerid );
free( tc );
}