]> granicus.if.org Git - transmission/commitdiff
(trunk libT) use tr_valloc() in a couple of places where we allocate largish, short...
authorCharles Kerr <charles@transmissionbt.com>
Tue, 23 Feb 2010 07:29:21 +0000 (07:29 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 23 Feb 2010 07:29:21 +0000 (07:29 +0000)
libtransmission/makemeta.c
libtransmission/utils.c

index 603fb971cca9619703356d8deb31f38321f0e10e..786e91d4eddf865b5183721a39e0a8354e04c748 100644 (file)
@@ -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" );
index ced4e15975582b60549d287a2bb5460b7d3bd1ed..6eaaf6c1aaf6942a66bb9d2429d77995eec888fe 100644 (file)
@@ -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;