(trunk libT) safeguard against a minor memory leak if io->sokcet couldn't be opened.

This commit is contained in:
Jordan Lee 2011-03-29 21:09:37 +00:00
parent 66d60160b3
commit 72c55fcdd8
1 changed files with 8 additions and 0 deletions

View File

@ -715,8 +715,16 @@ io_close_socket( tr_peerIo * io )
if( io->socket >= 0 ) {
tr_netClose( io->session, io->socket );
io->socket = -1;
}
if( io->event_read != NULL) {
event_free( io->event_read );
io->event_read = NULL;
}
if( io->event_write != NULL) {
event_free( io->event_write );
io->event_write = NULL;
}
#ifdef WITH_UTP