(trunk libT) fix crash in tr_fdSocketClose() reported by agsystem in the forums @ http://forum.transmissionbt.com/viewtopic.php?p=42993&f=1#p42993

This commit is contained in:
Charles Kerr 2009-12-26 23:52:59 +00:00
parent a3b7c17437
commit 8bc90ca644
1 changed files with 10 additions and 10 deletions

View File

@ -725,20 +725,20 @@ tr_fdSocketAccept( tr_session * session,
void
tr_fdSocketClose( tr_session * session, int fd )
{
struct tr_fdInfo * gFd;
assert( tr_isSession( session ) );
assert( session->fdInfo != NULL );
gFd = session->fdInfo;
if( fd >= 0 )
if( session->fdInfo != NULL )
{
tr_netCloseSocket( fd );
--gFd->socketCount;
}
struct tr_fdInfo * gFd = session->fdInfo;
assert( gFd->socketCount >= 0 );
if( fd >= 0 )
{
tr_netCloseSocket( fd );
--gFd->socketCount;
}
assert( gFd->socketCount >= 0 );
}
}
/***