(trunk libT) two bugfixes in one: (1) fix leaking tr_handshake objects reported by BentMyWookie (2) fix yet another permutation of the tr_isBandwidth() assertion failure -- maybe the last one? -- reported by Waldorf

This commit is contained in:
Charles Kerr 2009-01-06 00:24:44 +00:00
parent 30a989f1df
commit 3ff145f058
3 changed files with 3 additions and 6 deletions

View File

@ -1091,7 +1091,7 @@ fireDoneFunc( tr_handshake * handshake,
return success;
}
void
static void
tr_handshakeFree( tr_handshake * handshake )
{
if( handshake->io )
@ -1111,6 +1111,8 @@ tr_handshakeDone( tr_handshake * handshake,
success = fireDoneFunc( handshake, isOK );
tr_handshakeFree( handshake );
return success ? READ_LATER : READ_ERR;
}

View File

@ -38,8 +38,6 @@ tr_handshake * tr_handshakeNew( struct tr_peerIo * io,
const tr_address * tr_handshakeGetAddr( const struct tr_handshake * handshake,
tr_port * port );
void tr_handshakeFree( tr_handshake * handshake );
void tr_handshakeAbort( tr_handshake * handshake );
struct tr_peerIo* tr_handshakeGetIO( tr_handshake * handshake );

View File

@ -1268,9 +1268,6 @@ myHandshakeDoneCB( tr_handshake * handshake,
}
}
if( !success )
tr_handshakeFree( handshake );
if( t )
torrentUnlock( t );