Changeset 2241


Ignore:
Timestamp:
Jun 30, 2007, 12:46:45 PM (15 years ago)
Author:
charles
Message:

fix crash reported by persept

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer.c

    r2235 r2241  
    647647int tr_peerIsConnected( const tr_peer_t * peer )
    648648{
    649     return PEER_STATUS_CONNECTED == peer->status;
     649    return peer && (peer->status == PEER_STATUS_CONNECTED);
    650650}
    651651
  • trunk/libtransmission/torrent.c

    r2231 r2241  
    10681068
    10691069            /* receive/send messages */
     1070            tr_torrentWriterLock( tor );
    10701071            for( i=0; i<tor->peerCount; ) {
    10711072                tr_peer_t * peer = tor->peers[i];
     
    10891090                i++;
    10901091            }
     1092            tr_torrentWriterUnlock( tor );
    10911093        }
    10921094    }
Note: See TracChangeset for help on using the changeset viewer.