mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) use tr_valloc() in a couple of places where we allocate largish, short-term buffers
This commit is contained in:
parent
fad8f285a8
commit
6d639f354b
2 changed files with 2 additions and 2 deletions
|
@ -208,7 +208,7 @@ getHashInfo( tr_metainfo_builder * b )
|
|||
if( !b->totalSize )
|
||||
return ret;
|
||||
|
||||
buf = tr_new( uint8_t, b->pieceSize );
|
||||
buf = tr_valloc( b->pieceSize );
|
||||
b->pieceIndex = 0;
|
||||
totalRemain = b->totalSize;
|
||||
fp = fopen( b->files[fileIndex].filename, "rb" );
|
||||
|
|
|
@ -1428,7 +1428,7 @@ tr_moveFile( const char * oldpath, const char * newpath, tr_bool * renamed )
|
|||
in = tr_open_file_for_scanning( oldpath );
|
||||
out = tr_open_file_for_writing( newpath );
|
||||
buflen = stat( newpath, &st ) ? 4096 : st.st_blksize;
|
||||
buf = tr_new( char, buflen );
|
||||
buf = tr_valloc( buflen );
|
||||
while( bytesLeft > 0 )
|
||||
{
|
||||
ssize_t bytesWritten;
|
||||
|
|
Loading…
Reference in a new issue