Ignore:
Timestamp:
Dec 26, 2009, 11:52:59 PM (12 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r9810 r9825  
    726726tr_fdSocketClose( tr_session * session, int fd )
    727727{
    728     struct tr_fdInfo * gFd;
    729 
    730     assert( tr_isSession( session ) );
    731     assert( session->fdInfo != NULL );
    732 
    733     gFd = session->fdInfo;
    734 
    735     if( fd >= 0 )
    736     {
    737         tr_netCloseSocket( fd );
    738         --gFd->socketCount;
    739     }
    740 
    741     assert( gFd->socketCount >= 0 );
     728    assert( tr_isSession( session ) );
     729
     730    if( session->fdInfo != NULL )
     731    {
     732        struct tr_fdInfo * gFd = session->fdInfo;
     733
     734        if( fd >= 0 )
     735        {
     736            tr_netCloseSocket( fd );
     737            --gFd->socketCount;
     738        }
     739
     740        assert( gFd->socketCount >= 0 );
     741    }
    742742}
    743743
Note: See TracChangeset for help on using the changeset viewer.