mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
(trunk libT) The buffer is static anyway, no need to malloc it
This commit is contained in:
parent
98420365e9
commit
f3db4c14b7
1 changed files with 1 additions and 4 deletions
|
@ -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 ))) {
|
||||
|
|
Loading…
Reference in a new issue