mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
(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:
parent
a3b7c17437
commit
8bc90ca644
1 changed files with 10 additions and 10 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
|
|
Loading…
Reference in a new issue