diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 7b96f393d..5c0cc440b 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -218,6 +218,7 @@ event_read_cb( int fd, short event UNUSED, void * vio ) const unsigned int max = 256 * 1024; assert( tr_isPeerIo( io ) ); + assert( io->socket >= 0 ); io->pendingEvents &= ~EV_READ; @@ -293,6 +294,7 @@ event_write_cb( int fd, short event UNUSED, void * vio ) const tr_direction dir = TR_UP; assert( tr_isPeerIo( io ) ); + assert( io->socket >= 0 ); io->pendingEvents &= ~EV_WRITE;