1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

(trunk libT) The buffer is static anyway, no need to malloc it

This commit is contained in:
Charles Kerr 2009-01-08 14:05:30 +00:00
parent 98420365e9
commit f3db4c14b7

View file

@ -1693,10 +1693,7 @@ fillOutputBuffer( tr_peermsgs * msgs, time_t now )
&& tr_cpPieceIsComplete( &msgs->torrent->completion, req.index ) )
{
int err;
static uint8_t * buf = NULL;
if( buf == NULL )
buf = tr_new( uint8_t, MAX_BLOCK_SIZE );
static uint8_t buf[MAX_BLOCK_SIZE];
/* send a block */
if(( err = tr_ioRead( msgs->torrent, req.index, req.offset, req.length, buf ))) {